| Index > Scribe > Creating an email with a script | |
|---|---|
| Author/Date | Creating an email with a script |
| fret 06/01/2022 11:11am | So for the sake of documenting how you do this, here is a simple script to create an email from a tools menu item:
function CreateMail(App, MenuId)
{
outbox = GetFolder(1);
email = CreateThing(0xAAFF0001, outbox);
email.subject = "A subject";
recip = email.to[-1];
recip.email = "recipient@domain.com";
recip.name = "A name";
email.body = "Some content for the body...";
email.html = "What about the <b>HTML</b> content?";
ShowThingWindow(email);
}
function Main(App)
{
if (!AddToolsMenuItem("CreateMail", "CreateMail"))
MessageDlg(App, "Couldn't add hook");
return true;
} |
| Reply | |