What are the steps for sending an email (via SMTP) in PuTTY? Also, is it possible to attach files?
4 Answers
yOU CAN ALSO READ ALL WRITTEN BELOW HERE
1) In the "Session" screen under "Host Name" you will need to specify your domain name. For "Protocol", you will need to select SSH.
2) Next, you will need to click on "Connection" in the Category menu on the left, click "SSH", then click "Tunnels".
3) Now, set up the tunnel for POP3 (used for receiving email). On this screen, in the "Add new forwarded port:" section, you will need to specify "5110" (without the quotes) for Source Port and pop.example.com:110 (where "example.com" is replaced by your actual domain name) for the Destination, as shown below. Make sure "Local" is selected, then click "Add".
4) Next, we need to set up the tunnel for SMTP (used for sending email). On the same screen as above, again under "Add new forwarded port", you will need to enter "5025" (without the quotes) for Source Port and mail.example.com:25 (where "example.com" is replaced by your actual domain name) for the Destination, as shown below. Leave "Local" selected and click "Add".
5)now go back to the "Session" category in the menu on the left. Under "Saved Sessions" you will need to fill in a name to refer to the configuration options you've just set so that you will be able to easily load them in future sessions. We have chosen to name this default session "SecureEmail". Once you have entered the name, click on "Save". Your settings will be stored and you should now see the name of your session listed in the Default Settings box.
To open the tunnel, you will simply need to double-click the session name (or click once to highlight the session name and choose "Open").
6)Once you have done so, an SSH window will open up and you will be asked for your account access information. The username and password you enter will need to be that of your FutureQuest account, the same information you use to login to your CNC or use in your FTP client. After entering your username and password, you will not need to do anything else on this screen. However, you do need to keep it OPEN.
-
1
-
4While this answer may contain useful information about how to forward ports with Putty, it really has nothing to do with the original question Mar 14, 2011 at 17:47
Just connect to the server using telnet and port 25, then you just type the mail commands:
HELO pcyourconnectingwith.internalorexternaldomain.com
Hit enter and usually the server will love you back.
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
Usually it will tell you to have a last line with just a . when you're done.
Subject: This is the subject
Press enter twice here.
Now type the body. If you use some base64 encoder and figure how to paste that in so that it's an attachment, then you are cooler then I am.
Press enter to make sure you are on a new empty line.
.
At this point it should tell you that it's queued.
exit
And that's it.
Two ways:
Use Putty/SSH to connect to a remote Unix-like system. Then you can use
mutt
,pine
,alpine
,mail
,elm
,mailx
and various other programs to send mail.Use Putty/Telnet to connect to the remote SMTP server and issue commands manualy. This is also described here and here. Normally, this should only be done for testing reasons.
Disregard this answer Ayush have given a proper answer and I never know that setting, this answer would right if you want to send email within SHELL.
Putty has nothing to do sending email. I assume you want to send email from a UNIX server. What is the UNIX flavor you use? Try command like mail
or mailx
. Then you may try uuencode
option with the mail command.
The options:
mailx [-s subject] [-a attachment ] [-r from-addr] to-addr . . .
-s subject of email (could be inserted later)
-r indicates the email's sender (not a standard argument)
-a file to be attached to email (in some versions only, please check man pages of mailx for your platform)
-a specify additional header fields (in other versions)
Like
echo "Some message for email body" | mailx -s "meeting today" [email protected]
To send attachment you would do:
( cat mesgfile.txt; uuencode Test.dat Test.dat ) | mailx -s 'Testing' [email protected]
The uuencode command takes two parameters. 1: the file you want to send, 2: name you want to send.