Home > Java Mail, Weblogic > Sending emails via command line

Sending emails via command line

If you are trying to set up email notification in Weblogic and your emails are not getting through to your inbox, it might be nothing wrong with your application server configurations, but rather a problem with the email server itself. To test if a regular mail is being sent without having to configure a mail client with that server, you can use the steps below to send an email via command line:

telnet <email_server_hostname> 25
S: 220 smtp.example.com ESMTP Postfix
C: HELO something.com
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM: someone@something.com
S: 250 Ok
C: RCPT TO:radu@gmail.com
S: 250 Ok
C: RCPT TO:someoneyoumightwanttocc@gmail.com
S: 250 Ok
S: 354 End data with “.”
C: From: “Bob Example” <bob@example.org>
C: To: “Alice Example” <alice@example.com>
C: Cc: theboss@something.com
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C: Hello Radu,
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Someone
C: .
S: 250 Ok: queued as 12345
S: 221 Bye
{The server closes the connection}


  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: