Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Does anyone know how to sent email to myself?
I am trying to generate TCP traffic on port 25.

share|improve this question
2  
Do you just want the email, or do you want to test an SMTP server on your machine? –  Keith Jan 21 '13 at 1:54
    
You open up your favorite email program, fire up a new message editing window, put your email address in the "to"-field and you're good to go. Assuming your email program is configured correctly that will generate traffic on port 25 at least once on at least one host which goes beyond TCP connection requests. I think you need to put more effort into asking your question because the simple answer is "yes". –  Bananguin Jan 22 '13 at 13:24
add comment

3 Answers

# echo "This is message body" | mail -s "This is subject" you@domain.com

Or

# mail -s "My Subject" you@yourdomain.com < msg.txt
share|improve this answer
    
Originally I included this in my answer. However, after verifying the mail.log, the mail command seems to call mail queue directly, which bypass TCP/IP. –  John Siu Jan 24 '13 at 2:20
    
That's good to know. Hope that helps someone too. Thank you. –  Mardanian Jan 24 '13 at 15:31
add comment

telnet (to test out smtp protocol)

If you are trying to send email to yourself on the email server

telnet localhost 25

In this case you properly do not need to worry about correct HELO or login stuff, as email server generally will accept anything from localhost.

If you are trying to send email to yourself to an email server

telnet <email-server> 25

In this case depends on the configuration, the email server may reject your email if your box is not an email server(no mx record or spf record, etc).

Then follow this Tutorial link

share|improve this answer
    
Instead of telnet, you can also use netcat. –  jofel Jan 21 '13 at 9:11
    
@jofel True, it is almost identical in this usage. –  John Siu Jan 21 '13 at 21:27
    
yet you are not sending an email to anybody and calling an established TCP connection "generating traffic on port 25" is a little optimistic as well :-) –  Bananguin Jan 22 '13 at 13:26
    
@user1129682 I included the tutorial link for it. –  John Siu Jan 22 '13 at 17:39
add comment

Do you need to test if an smtp server works or to send some email by a shell script?

SWAKS - Swiss Army Knife for SMTP

Swaks is a featureful, flexible, scriptable, transaction-oriented 
SMTP test tool written and maintained by John Jetmore. Features include:
* SMTP extensions including TLS, authentication, and pipelining
* Protocols including SMTP, ESMTP, and LMTP
* Transports including unix-domain sockets, internet-domain sockets 
  (IPv4 and IPv6), and pipes to spawned processes
* Completely scriptable configuration, with option specification 
  via environment variables, configuration files, and command line
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.