Sendmail syntax to send mail

Posted on 2004-11-15
Last Modified: 2012-06-21
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
Question by:damieneowen
    LVL 19

    Expert Comment

    by:Daniel Van Der Werken
    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.
    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
    LVL 19

    Expert Comment

    by:Daniel Van Der Werken

    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

    LVL 6

    Expert Comment

    LVL 5

    Accepted Solution

    Try this generic procedure for testing SMTP (>> is stuff you type, << is stuff you get back):

    $ telnet 25 (or telnet yourhost:25 on some systems)

    << 220 blah blah
    >> HELO yourclientname
    << 250 Hello [ip address]
    >> mail
    << 250 2.1.0 ...Sender OK
    >> rcpt
    << 250 2.1.5
    >> 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


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    This video demonstrates basic masking and how to edit the mask to reveal the desired image.
    The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now