Thanks for the code that Fat Captain provided and I am able to send email automatic via lotus notes.
Codes as follow (copy and paste from/by Fat Captain)
/*** Create vbs code ***/
data _null_;
file "c:\temp\AutoEmail.vbs";
put 'Set fso = CreateObject("Scripting.FileSystemObject")';
put 'Set theFile=fso.CreateTextFile ("C:\temp\Email_body.htm", vbTrue)';
put 'theFile.WriteLine "<HTML>"';
put 'theFile.WriteLine "<BODY>"';
put 'theFile.WriteLine "Example email with attachment.<br>"';
put 'theFile.WriteLine "</BODY>"';
put 'theFile.WriteLine "</HTML>"';
put 'theFile.Close';
put 'Set EmailBody = fspenTextFile("C:\temp\Email_body.htm",1)';
put 'MyHTML = EmailBody.ReadAll';
put 'EmailBody.Close';
*Send email, auto send scripts;
put 'Set Session = CreateObject("Notes.NotesSession")' ;
put 'Set Database = Session.GETDATABASE("", "")' ;
put 'If Database.IsOpen = False Then Database.OPENMAIL' ;
put 'Set Document = Database.CreateDocument ' ;
put 'With Document' ;
put '.Form = "Memo"' ;
put '.SendTo = "me@mycompany.com"';
put '.Subject = "SAS Test email"';
put '.Body = "This is the body of the email"' ;
put '.SaveMessageOnSend = True' ;
put 'End With' ;
put 'With Document' ;
put '.PostedDate = Now()' ;
put '.Send 0' ;
put 'End With' ;
run;
/*Run vbs file */
x '"c:\temp\AutoEmail.vbs"';
my question is that I need to insert an attachment and a hyperlink. any ideas how?? Thanks.
Codes as follow (copy and paste from/by Fat Captain)
/*** Create vbs code ***/
data _null_;
file "c:\temp\AutoEmail.vbs";
put 'Set fso = CreateObject("Scripting.FileSystemObject")';
put 'Set theFile=fso.CreateTextFile ("C:\temp\Email_body.htm", vbTrue)';
put 'theFile.WriteLine "<HTML>"';
put 'theFile.WriteLine "<BODY>"';
put 'theFile.WriteLine "Example email with attachment.<br>"';
put 'theFile.WriteLine "</BODY>"';
put 'theFile.WriteLine "</HTML>"';
put 'theFile.Close';
put 'Set EmailBody = fspenTextFile("C:\temp\Email_body.htm",1)';
put 'MyHTML = EmailBody.ReadAll';
put 'EmailBody.Close';
*Send email, auto send scripts;
put 'Set Session = CreateObject("Notes.NotesSession")' ;
put 'Set Database = Session.GETDATABASE("", "")' ;
put 'If Database.IsOpen = False Then Database.OPENMAIL' ;
put 'Set Document = Database.CreateDocument ' ;
put 'With Document' ;
put '.Form = "Memo"' ;
put '.SendTo = "me@mycompany.com"';
put '.Subject = "SAS Test email"';
put '.Body = "This is the body of the email"' ;
put '.SaveMessageOnSend = True' ;
put 'End With' ;
put 'With Document' ;
put '.PostedDate = Now()' ;
put '.Send 0' ;
put 'End With' ;
run;
/*Run vbs file */
x '"c:\temp\AutoEmail.vbs"';
my question is that I need to insert an attachment and a hyperlink. any ideas how?? Thanks.