- 製 品
- 購 入
Order Online Maintenance Renewal Resellers - サポート
Helpdesk オンラインドキュメント(英語) Webフォーラム(英語) - Our Clients
- 当社について
About as サービス Contact
Back to Tutorials list
Back to Tutorials list
Sending e-mails (SMTP)
To attach a file to the message, use the code like below:
[C#]Smtp mailer = new Smtp(); mailer.AddAttachment(@"C:\My Documents\Report.xls");[VB.NET]
Dim mailer As New Smtp()
mailer.AddAttachment("C:\My Documents\Report.xls")
Smtp.AddAttachment method is in fact the call of Smtp.Message.Attachments.Add method. The developer can use overloads of that Add method to add attachments from other sources (memory array, stream, forwarded e-mail, attachments of specific types, etc). The advanced overloads also allow you to specify the display name of the attachment and other parameters.
For instance, the code below can be used to attach a file named B4DVIS9H.TMP so that it will appear as "Annual report.doc" in the message:
[C#]
mailer.Message.Attachments.Add("C:\DataFiles\B4DVIS9H.TMP", "Annual report.doc");
[VB.NET]
mailer.Message.Attachments.Add("C:\DataFiles\B4DVIS9H.TMP", "Annual report.doc")