wwSmtp::AddAttachment

Adds one or more file attachments to the mail message.

*** Content type is optional and only used  when using the .NET object
loSmtp.AddAttachment("c:\images\sailbig.jpg","image/jpeg")
loSmtp.AddAttachment("c:\images\sailbig.jpg","image/jpeg")
o.AddAttachment(lcFileName, lcContentType)

Parameters

lcFileName
Name of the file to send to the server. Should be a fully qualified filename

In .NET Mode you can also pass an System.Net.Mail.Attachment object.

lcContentType
Optional - In .NET mode you can optionally specify the content type which gets embedded with the attached file. Usually this isn't necessary as most mail clients will sniff the content type based on the file extension.

This parameter is ignored if set in classic mode.

Remarks

Do not use this method if you are making multiple SendMessage() (rather than SendMail) calls. Attachments added in .NET mode will not work for multiple sends of the same attachment object instance.

If you use SendMessage() to resend on the same connection and you need to add attachments add them with the .cAttachment property instead.


See also:

Class wwSmtp | wwSMTP::cAttachment

© West Wind Technologies, 2023 • Updated: 11/29/16
Comment or report problem with topic