In the past I have used Blat, which has suited my needs perfectly. However in recent times, I have had more and more issues with Exchange and firewalls, so decided to see if I could write one for my needs.
And so came about CPS.MiniMailer. Its not very sophisticated (yet) but it does allow me to send mails through our Exchange 2008 server, as well as Google Mail.
Heres a breakdown of the switches
| CPS.MiniMailer.exe | ||
| -h | Displays list of switches | |
| -srv | SMTP server address or name | |
| -p | SMTP Port number | |
| -t | Mail To (multiple addresses separated by commas | |
| -f | Mail From | |
| -sub | Subject (enclose sentence in double quotes) | |
| -b | Body (if HTML mail, can be html formatted string) | |
| -du | Domain user (Exchange) or user name (GMail etc) | |
| -dp | password for -du | |
| -html | 1 for HTML formatted mail, 0 for plain text | |
| -a | Attachments, surround paths with double quotes, multiple files separated by comma's | |
To edit the config file, open it into notepad, and find the relevant setting (so for the From setting we would look for <setting="From" serializeAs="String"> )and then edit the the text between the <value> and </value> tags.
An example of a command line (or batch file) using GMail is
CPS.MiniMailer.exe -srv smtp.gmail.com -p 587 -f mylogin@gmail.com -t blogs@cadpro.co.nz -sub "Test Gmail Mail" -du mylogin@gmail.com -dp myPassword
And for exchange
CPS.MiniMailer.exe -srv myExhcnageSrv -p 25 -f myname@mycompany.com -t blogs@cadpro.co.nz -sub "Test ExchangeMail" -du myDomainName -dp myDomainPassword
You can download the mailer from CADPRO Systems MiniMailer Utility
Please post any questions or comments, and when changes are made we'll append to this blog
0 comments:
Post a Comment