@MailSend and Attachments

I would like to send an email from a form which contains both the message and the attachment. With the current code on my button only the message is included NOT the attachment. What do I need to do in order to receive the attachment as well?

My form consists of SaveOptions and MailOptions fields set to 1, a message (text) field and an upload control field. Also, I have a SendTo field. Here is the code:

res := @PickList( [Custom] ; “”; “Select_users” ; “Selecting Recipients” ; “Please select the recipients you would like the email to be sent to”; 2);

FIELD SendTo :=res;

@MailSend(res; “”; “”; “PDMO”; Message; “”; “”);

@Command([FileSave]);

@Command([FileCloseWindow])

Many thanks in advance.

Subject: @MailSend and Attachments

Hi,

Check @MailSend function description in Designer help. You have to use bodyFields parameter to include addtitional data to Your mail memo - this should be Your upload field name.

Regards,

Konrad

Subject: RE: @MailSend and Attachments

Thank you very much for the reply Konrad. I tried that but without success, with this code as well only the message field is received and no attachment!@MailSend(“fatsoua@fatsoua.com”;“”;res;“PDMO”;Message;“”;“UploadControl”);

Any other ideas?

Subject: RE: @MailSend and Attachments

Did You try use @Command([FileSave]); before @MailSend?

Konrad

Subject: RE: @MailSend and Attachments

Yes I have Konrad but with no success.

Subject: RE: @MailSend and Attachments

You could try rewriting the code in Lotusscript, you have much better control over things that way.If you are lazy, just use my script library:

http://blog.texasswede.com/lotusscript-mail-notification-class/

:slight_smile:

Subject: RE: @MailSend and Attachments

Thank you very much Karl-Henry for your reply and for your very useful script. I will definitely give it a try. :slight_smile: