Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I send a Email with attachments using NMSMTP?

Status
Not open for further replies.

unknownx

Technical User
Feb 12, 2008
2
0
0
MX
How do I send a Email with attachments using NMSMTP?
Give me some examples, please. Thanks.
 
You must replace hostname, filename, addresses, etc with valid email and host and filenames of course. Hope this helps!

smtpServer.Host := 'hostname';
smtpServer.Connect;
try
smtpServer.PostMessage.Attachments.Add('filename');
smtpServer.PostMessage.FromAddress := 'fromaddress';
smtpServer.PostMessage.FromName := 'fromname';
smtpServer.PostMessage.Subject := 'your subject';
smtpServer.PostMessage.ToAddress.Add('toaddress');
smtpServer.SendMail;
finally
smtpServer.Disconnect;
end;
TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top