Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What are the steps for sending an email (via SMTP) in PuTTY? Also, is it possible to attach files?

share|improve this question
    
Are you asking about connecting directly to the SMTP server and issuing commands by hand? –  thkala Feb 12 '11 at 21:30
add comment

migrated from stackoverflow.com Feb 12 '11 at 23:17

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted

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.

enter image description here

2) Next, you will need to click on "Connection" in the Category menu on the left, click "SSH", then click "Tunnels".

enter image description here

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".

enter image description here

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".

enter image description here

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.

share|improve this answer
1  
+1. I never know this. Will check it how it works. :) –  Guru Feb 12 '11 at 21:41
1  
While this answer may contain useful information about how to forward ports with Putty, it really has nothing to do with the original question –  Adam Batkin Mar 14 '11 at 17:47
add comment

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.

share|improve this answer
add comment

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" somebody@example.com

To send attachment you would do:

( cat mesgfile.txt; uuencode Test.dat Test.dat ) | mailx -s 'Testing' mymail@yexample.com

The uuencode command takes two parameters. 1: the file you want to send, 2: name you want to send.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.