Sendmail

To list the sendmail Queue

 # sendmail -bp
 NAA20852     2235 Fri Dec 14 13:14 MAILER-DAEMON
                 (Deferred: Connection refused by prophet.qa.haht.com.)
                                   <netsaint at prophet.qa.haht.com>
 NAA21610    16176 Fri Dec 14 13:26 MAILER-DAEMON
                 (Deferred: Connection refused by maillist.newsfactor.com.)
                                   <nlsystem at maillist.newsfactor.com>

To delete the deferred messages

For Sendmail the queue directory in many UNIX is

   /var/spool/mqueue/...

Looking at the directory, you will see a bunch of file that start with:
df..., qf..., or xf...
After that the file name contains a combination of 3 letters and 5 numbers.
This second part matches the output you got from the "sendmail -bp" command.
Here is an example:

   dfNAA20852  dfNAA21610  qfNAA20852  qfNAA21610

If you wanted to delete the Message NAA20852 (to
netsaint at prophet.qa.haht.com) you would move to the queue directory and:

   rm ??NAA20852

Boom! The message is now gone from your queue.
Please note, that if you are going to be playing with your queued up
messages, you should STOP SENDMAIL first:

   /etc/rc.d/init.d/sendmail stop

To manually process the defered/queued up messages

 # sendmail -q -v

sendmail.cf

 DS<smtp relay>     # SMTP mail relay
 Dj<domain name>    # Official or fully qualified domain name
 DM<Domain Name>    # masquerade as 

 sendmail.cw defines alternate local mail addresses for the host.
 sendmail.cR defines hosts that are allowed to relay through the current  
             host (ie non-local addresses that the host will accept mail from).

Sending email using sendmail prompt

telnet mail 25
Trying...
Connected to mail.
Escape character is '^]'.
220 xxxx.xxx.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at  Tue, 24 Jun 2008 18:47:25 -0700
helo
250 xxxx.xxx.com Hello [192.168.128.25]
Mail From: test@test.com
250 2.1.0 test@test.com....Sender OK
RCPT To: test@xyz.com
250 2.1.5 test@xyz.com
data
354 Start mail input; end with <CRLF>.<CRLF>
test mail
.
250 2.6.0 <AEMEXPA6FapNuT1FM1J00000437@xxxx.xxx.com> Queued mail for delivery