Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autosend SAS via Lotus Notes

Status
Not open for further replies.

K2012

Programmer
Aug 8, 2012
1
US
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 = fso_OpenTextFile("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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top