MEMail.Message & Multiple Attachments

Discussions on webmail and the Professional version.
Post Reply
appaulled
Posts: 20
Joined: Mon Feb 14, 2005 8:38 pm
Location: USA

MEMail.Message & Multiple Attachments

Post by appaulled »

Has anyone found documentation or figured out how to attach multiple files to a message using .AttachmentFileName and .AttachmentName?

I am using ASP and am stuck!

appaulled
Posts: 20
Joined: Mon Feb 14, 2005 8:38 pm
Location: USA

Multiple Attachments

Post by appaulled »

This came from ME tech support:

oMail.MailFrom = "peter@mailenable.com"
oMail.MailFromDisplayName = "My Account"
oMail.MailTo = "peter@mailenable.com"
oMail.ContentType = "text/html;"
oMail.AddAttachment "c:\myfile1.pdf", "The file1.pdf"
oMail.AddAttachment "c:\myfile2.pdf", "The file2.pdf"
oMail.AddAttachment "c:\myfile3.pdf", "The file3.pdf"
oMail.Subject = "<B>New update information</B>"
oMail.MessageBody = sContents
oMail.SendMessage

mlopilato
Posts: 15
Joined: Sun Feb 03, 2008 5:59 pm

Re: MEMail.Message & Multiple Attachments

Post by mlopilato »

How can I add attachments programmatically?
This is what I have now, but the attachments are missing with no errors.
If ucase(mailtype)="MEMAIL" Then
Set Mailer = Server.CreateObject("MEMail.Message")
if err.number<> 0 then
mailerror= getlang("langmailerror") & " " & mailtype
HandleMailError mailerror
exit sub
end if
Mailer.MailTo = my_toaddress
Mailer.MailFrom = my_fromaddress
Mailer.MailFromDisplayName = my_from
Mailer.Subject = my_subject
Mailer.MessageBody = body
If htmlformat="HTML" then
Mailer.ContentType = "text/html"
end if
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
Mailer.AddAttachment orderattachments(i), "download" &(i) &".zip"
If getconfig("xdebug")="Yes" then
Debugwrite "adding " & orderattachments(i)
end if
next
Orderattachmentcount=0
end if
Mailer.SendMessage
set mailer=nothing
exit sub
end if

Post Reply