Welcome! Log In Create A New Profile

Advanced

Email Attachments

Posted by norfolk-reg 
Email Attachments
November 12, 2018 03:56PM
WD22

Hi, although I'm building an email variable with two attached files on it when the email arrives only the second file is there? I'm sending via the SMTP construct. The code to add the attachments is


StringToArray(gsemref:sEM_Attachment,arrAttach,";")
i is int = 1
FOR EACH sAttfile OF arrAttach
IF sAttfile = "" THEN CONTINUE
MyMessage.Attach.Name = sAttfile
MyMessage.Attach.content = fLoadText(sAttfile)
MyMessage.Attach.ContentType = "application/pdf"
MyMessage.Attach.contentdescription = ""
MyMessage.Attach.identifiant=sAttfile
i ++
END

And the sending code is:

EmailSetTimeOut(30)
HourGlass(True)
IF NOT EmailStartSession(MySession) THEN
HourGlass(False)
Error(ErrorInfo(errMessage))
RESULT nFailed
END
IF NOT EmailSendMessage(MySession,MyMessage) THEN
HourGlass(False)
Error(ErrorInfo(errMessage),"Unable to send Email message")
RESULT nFailed
END
HourGlass(False)
EmailCloseSession(MySession)


Is there enough here for anyone to see if I'm doing anything wrong?


Many Thanks
Reg
Re: Email Attachments
November 12, 2018 04:29PM
Hi Reg,

Maybe you have to look at Email.NbAttach.

Best regards,

Aad
Re: Email Attachments
November 15, 2018 10:46AM
Thanks Aad, got it sussed. smileys with beer
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: