Below is an exctract of code I found to for sending email. How would I attach a file to the email? Is there a better way?
* Send mail to a user=============================
strProfile = "MyUserID"
strPassword = "MyPassWord"
public strRecipient[2]
strRecipient[1] = "
MyUserID@domain.com"
strRecipient[2] = "
Reciepent@domain.com"
strSubject = "AutoMail - Distribution Test"
PUBLIC lcBody
lcBody = ''
PUBLIC lcLines[2]
lcLines[1] = "LIPCA Insurance Group : Auto-Mail Router *** DO NOT REPLY TO THIS MESSAGE ***"+Chr(13)
lcLines[2] = Replicate('=',Len(lcLines[1]))+Chr(13)
theApp = CreateObject("Outlook.Application")
theNameSpace = theApp.GetNameSpace("MAPI")
theNameSpace.Logon(strProfile , strPassword)
theMailItem = theApp.CreateItem(0)
theMailItem.Recipients.Add( strRecipient[1] )
theMailItem.Recipients.Add( strRecipient[2] )
theMailItem.Subject = strSubject
theMailItem.Body = lcBody
theMailItem.Send
theNameSpace.Logoff
Best Regards,
Lee Roy J. Pitre, Jr, AAS, BA, MS
Pitre Computer Consultant & Associates
http://pitres.us