lotus notes - attachments

priyamB
priyamB used Ask the Experts™
on
i have the following code to send an email with an attachment:


Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")

Call MailDoc.ReplaceItemValue("SendTo", "PT105_02")
Call MailDoc.ReplaceItemValue("Subject", "Subject Text")
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Body text here")
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\TEST.txt", "testAttachment")
MailDoc.SAVEMESSAGEONSEND = True


Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)

Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing

I see the mail with the attachment in the notes client but its not being picked up by the mail server..also when I create a mail with attachment manually the icon for the attachment looks different..
Please help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Everything looks good except this line...

    Call MailDoc.ReplaceItemValue("PostedDate", Now())

Remove that line and it should work.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial