• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8109
  • Last Modified:

Sendmail syntax to send mail

Hi
ive installed sendmail and the its running as is the daemon, what can i do at this point to check its working,
what syntax do i need to type into the terminal window to basically send an e-mail to itself. im using red hat 9.0
0
damieneowen
Asked:
damieneowen
  • 2
1 Solution
 
Daniel Van Der WerkenIndependent ConsultantCommented:
Does this example do what you need?


testing:~> mail -v dwerken   <=== this is the command
Subject: Hey
Testing                       <=== NOTE:  I hit CTRL-D to exit from the text entry mode.
Cc:
LOG: 0 MAIN
  <= dwerken@testing U=dwerken P=local S=314
testing:~> Exim version 3.35 debug level 1 uid=8 gid=8
Berkeley DB: Sleepycat Software: Berkeley DB 2.7.7: (08/20/99)
delivering message 1CTkVN-0005kC-00
LOG: 0 MAIN
  => dwerken <dwerken@testing> D=localuser T=local_delivery
LOG: 0 MAIN
  Completed
0
 
Daniel Van Der WerkenIndependent ConsultantCommented:
...continued

After you send the mail, you'd type "mail" at the prompt to see if you got it:

testing:~> mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/dwerken": 1 message 1 new
>N  1 dwerken@testing    Mon Nov 15 12:19   14/421   Hey
&

---Dan---
0
 
mrwebdevCommented:
0
 
NashvilleGuitarPickerCommented:
Try this generic procedure for testing SMTP (>> is stuff you type, << is stuff you get back):


$ telnet yourmailhost.whatever.com 25 (or telnet yourhost:25 on some systems)

<< 220 yourmailhost.whatever.com blah blah
>> HELO yourclientname
<< 250 yourmailhost.whatever.com Hello [ip address]
>> mail from:someaddress@hotmail.com
<< 250 2.1.0 yourmailhost.whatever.com ...Sender OK
>> rcpt to:someaddress@yourmailhost.whatever.com
<< 250 2.1.5 someaddress@yourmailhost.whatever.com
>> data
<< 354 Please start mail input.
>> Subject: Test message
>>
>> This is a test...
>> Testing 1-2-3
>> .
(note, ^^^^  that is a period on an otherwise blank line to end)
<< 250 Mail queued for delivery.
>> quit

This was tested on Exchange, but it should work for any other SMTP server.  Please don't make any typos, since backspace usually doesn't work as expected.

I hope this helps.

- Will

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now