Sending Spam with SWT
import org.eclipse.swt.*;
import org.eclipse.swt.ole.win32.*;
import org.eclipse.swt.widgets.*;
public class Spam {
public static void main(String args[]) {
// Only needed to obtain an OleFrame
Display display = new Display();
Shell shell = new Shell(display);
// Only needed to get a site
OleFrame frame = new OleFrame(shell, SWT.NONE);
OleClientSite site = new OleClientSite(frame, SWT.NONE, "Outlook.Application");
// Activate Outlook
site.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
OleAutomation outlook = new OleAutomation(site);
OleAutomation mail = invoke(outlook,"CreateItem",0 /*Mail item*/).getAutomation();
setProperty(mail,"To","spam");
setProperty(mail,"BodyFormat",2 /* HTML */);
setProperty(mail,"Subject","Spam freshly made");
setProperty(mail,"HtmlBody","
Spam4U
");
invoke(mail,"Display" /* or "Send" */ );
outlook.dispose();
shell.dispose();
display.dispose();
}
// These helper methods facilitate writing the OLE apps
private static Variant invoke(OleAutomation auto, String command) {
return auto.invoke(property(auto,command));
}
private static Variant invoke(OleAutomation auto, String command, String value) {
return auto.invoke(property(auto,command),
new Variant[] { new Variant(value)});
}
private static Variant invoke(OleAutomation auto, String command, int value) {
return auto.invoke(property(auto,command),
new Variant[] { new Variant(value)});
}
private static boolean setProperty(OleAutomation auto, String name, String value) {
return auto.setProperty(property(auto,name), new Variant(value));
}
private static boolean setProperty(OleAutomation auto, String name, int value) {
return auto.setProperty(property(auto,name), new Variant(value));
}
private static int property(OleAutomation auto, String name) {
return auto.getIDsOfNames(new String[] { name })[0];
}
}
Related posts:
- Blog Comment Spam and WordPress Anti-Spam Plugins
- Fighting Form Spam with CSS
- Top Eclipse Plugins
- Top 10 Eclipse Hotkeys
- Avoid Spam in Input Forms
- Block referer spam easily
- Howto: Convert an OpenSSL key to a public/private OpenSSH key-pair
- Java and C# Client Server Socket Programming
- SSL: Verifying that a Certificate matches a Private Key
- MySQL Concatenate: Adding String At The End Of Field Data
Popular Related Items »
Incoming search terms
- automotive_swt
- swt send email
- email outlook swt
- oleframe tutorial
- org eclipse swt ole win32 OleAutomation Outlook
- outlook automation with SWT OLE
- send email SWT
- swt generate mail cc -email never shown
- swt ole automation key value pair
- swt ole frame tutorial
- swt ole32 tutorial
- swt oleautomation
- swt OleAutomation mail
- swt outlook
- SWT setProperty(mail ”BodyFormat” 2 /* HTML */);
- OleClientSite word readonly protected
- OleClientSite vista
- automotive_swt theme
- crack window design swt linux
- Create a vista theme shell swt win32
- display
- eclipse swt outlook
- java getIDsOfNames OleAutomation Microsoft Outlook
- java swt ole mailitem Automation
- java swt ole tutorial
- Ole Automation outlook invoke display
- ole2 tutorial GetIDsOfNames
- OleAutomation mail = invoke(outlook CreateItem 0 /* Mail item */)
- oleautomation swt
- oleautomation swt outlook
- windows theme java swt
