tag:blogger.com,1999:blog-59506380106078305302024-03-14T01:59:57.380+05:30Tech Tipvivekhttp://www.blogger.com/profile/09423761144180477228noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5950638010607830530.post-63587720532918515172011-07-29T15:21:00.002+05:302011-07-29T15:24:19.608+05:30How to Send Mail from Cmd Prompt | How To<div dir="ltr" style="text-align: left;" trbidi="on"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Hello world !! I have spent vast time on internet for technical support on various forums. So hmmm that's why started the blog, so i could share something which may help you out. :)</span><br />
<div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">"Blog for solving tech issues and getting things done" ;). OK, Now there one of those, most of the time you have tried to send email using your defualt Telnet program using command</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Telnet smtp.gmail.com 25</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">which ask you to start <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS</a> Protocol before any other command and despite of that you end up with 'connection lost' message.</span></div><div style="font-family: arial; font-size: small;"><br />
</div><div style="font-family: arial; font-size: small;"><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1-hKKU7CnITyJhZ-pZy3WhuCXdl3WQlkR_kx7UYTa9SmsgyU1MJ-KgniMb-SF2Ei5Jn0NeYBz5z1S5SKNPON9HVg45baniQqhOevC3CkOM5TSDpc2OG9TzAP6wx-_4bvv_aGtSvSP-T5W/s1600/cmd.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1-hKKU7CnITyJhZ-pZy3WhuCXdl3WQlkR_kx7UYTa9SmsgyU1MJ-KgniMb-SF2Ei5Jn0NeYBz5z1S5SKNPON9HVg45baniQqhOevC3CkOM5TSDpc2OG9TzAP6wx-_4bvv_aGtSvSP-T5W/s400/cmd.jpg" width="400" /></a></div></div><div><div class="separator" style="clear: both; font-family: arial; font-size: small; text-align: center;"></div><div class="separator" style="clear: both; font-family: arial; font-size: small; text-align: center;"></div><div style="font-family: arial; font-size: small;"><br />
</div><div style="font-family: arial; font-size: small;"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Why, because the TLS command was never executed, common Windows Telnet doesn't support TLS protocol. So i got an other alternative there in linux ages ago - <a href="http://caspian.dotconf.net/menu/Software/SendEmail/">SendEmail</a> (or try <a href="http://www.google.co.in/url?sa=t&source=web&cd=1&sqi=2&ved=0CBcQFjAA&url=http%3A%2F%2Fcaspian.dotconf.net%2Fmenu%2FSoftware%2FSendEmail%2F&ei=ymwyToyjMYrWrQfzhZC8Cw&usg=AFQjCNFT3BPCr2nqZoI-1EPfs4spHNv24Q&sig2=V3q63Fo-VDJ1cyJqZN8UtQ">Google Cache</a>) download the (Windows) version which include TLS support. SendMail requires no instalation and no ini file configuration. Just drop it at C:\WINDOWS\system32 and its ready to use at CMD. Now start CMD and type :-</span></div></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">C:\Documents and Settings\user\Sendemail -t dking@gmail.com -u Test Email -m hi, Just checking it -f robchap@email.com -s smtp.gmail.com:587 -xu username -xp password</span></div><div style="font-family: arial;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Expanded here</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><b>-t</b> Reciptent Address</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>u</b> Subject of mail</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>m</b> Body Part</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>f</b> From Address</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>s</b> Servername:Portnumber (As suggested by service provider)</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>xu</b> Username</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>xp</b> Password</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">and numerous option to attach file and send anonymous mail. If some sort TLS error occurs add</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>o</b> tls=yes (even thought i was able to send mail without TLS support)</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">and 'enter', the mail will reach inbox within moments. This service can be used to send anonymous email by specifying any from address after </span><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">-<b>f</b>,<b> </b></span><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">if the smtp server it not restricted one it will deliver the mail. Using Sendmail you can save time by automating routine task like mailing statistic report every day using <a href="http://support.microsoft.com/kb/308569">Windows Scheduler</a>, to do that click Start, click All Programs, point to Accessories, point to System Tools then click Scheduled Tasks and double-click 'Add Scheduled Task', click 'Browse' locate folder containing 'sendmail.exe' and enter parameters (to attach file use -<b>a</b> FileLocation ) as shown</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN2IET1_RuLzLcgC75aTV0jpdNYJClC-FPlT0UvE4JG4EIHX0ibomp_-XQiQ1ylAyCp73veG2OP9tMgr3GFQZqCDH2ThmXm6686Mpb_7jl563yYRcZM8FV-IKcfdpwDTtvim3GL7boBFyR/s1600/2011-07-29_143215.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN2IET1_RuLzLcgC75aTV0jpdNYJClC-FPlT0UvE4JG4EIHX0ibomp_-XQiQ1ylAyCp73veG2OP9tMgr3GFQZqCDH2ThmXm6686Mpb_7jl563yYRcZM8FV-IKcfdpwDTtvim3GL7boBFyR/s320/2011-07-29_143215.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">As the mail is sent directly from your computer information about <a href="http://en.wikipedia.org/wiki/Hostname">Hostname</a> and IP address is revealed, so general usage should be avoided.</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~~</span></div></div></div>vivekhttp://www.blogger.com/profile/09423761144180477228noreply@blogger.com0