Jul 23, 2001 #1 unknownx Technical User Feb 12, 2008 2 MX How do I send a Email with attachments using NMSMTP? Give me some examples, please. Thanks.
Jul 26, 2001 #2 TealWren Programmer Jun 7, 2001 231 US 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 Upvote 0 Downvote
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