Sample: Advanced SMTP Mail Sender
Advanced command line application for sending e-mail. Supports attachments
and is able to send either using the specified SMTP server, through IIS pickup directory
or directly to the recipients' mail servers determined from DNS MX records.
Usage
=====================================================================
MailSend.exe
=====================================================================
Sends e-mail from command line.
The program is a sample for Rebex Mail for .NET component.
For more info, see http://www.rebex.net/mail.net/
Syntax: MailSend.exe -method (iis|smtp|direct)
[-server[:port]]
[-from mail@domain]
[-to mail@domain[;mail2@domain2[...]]
[-subject "subject"]
[-body "text"]
[-attach file1.ext [-attach file2.ext [...]]
Or, for interactive mode: MailSend -interactive
More info
The sample demonstrates:
- Creating MailMessage
- Sending mail using the specified SMTP server
- Sending mail directly to recipient's SMTP server
- Sending mail via local windows mail pickup directory (part of Microsoft IIS and Microsoft Exchange)
- Adding attachments to the message
Note: For a similar WinForms application, check out
our WinForm Mail Sender sample.
See also: