LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2015, 08:13 AM   #1
sachinpawan
LQ Newbie
 
Registered: Sep 2015
Posts: 2

Rep: Reputation: Disabled
Mailx smtp returns an error


Hi Linux Gurus,

Am newbie to linux. am trying to send an email using mailx.
i have used following configuration to send an email. but it returns error.

Highly appreciate your help in this regard.

mailx -v -s "$EMAIL_SUBJECT" \
> -S ssl-verify=ignore \
> -S smtp-auth=login \
> -S smtp=192.168.11.121 \
> -S from="raju@gmail.com" \
> -S smtp-auth-user=myname \
> -S smtp-auth-password=password123 \
> -S ssl-verify=ignore \
> raju.out@rcckl.com
mailx: invalid option -- S
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[-- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]

Thanks
KRP
 
Old 09-10-2015, 07:55 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
If you look at the manpage you will see the following at the begininng:
Code:
SYNOPSIS
       mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-
              addr] [-r from-addr] [-h hops] [-A account] [-S vari
              able[=value]] to-addr . . .
       mailx [-BDdeEHiInNRv~] [-T name] [-A account] [-S variable[=value]] -f
              [name]
       mailx [-BDdeEinNRv~] [-A account] [-S variable[=value]] [-u user]
You want to use the "-S" option, which is only in the third entry. Yet you used the "-s" at the beginning, which is ONLY on the first entry.

Using "-s" does not allow for the use of "-S".

I THINK (not certain though) you have to include the "Subject:" header as part of the body of your message if you are going to be using the "-S" form.
 
Old 09-14-2015, 04:04 AM   #3
sachinpawan
LQ Newbie
 
Registered: Sep 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you jpollard for your kind response. will try as you suggested.

Regards,

KRP

Quote:
Originally Posted by jpollard View Post
If you look at the manpage you will see the following at the begininng:
Code:
SYNOPSIS
       mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-
              addr] [-r from-addr] [-h hops] [-A account] [-S vari
              able[=value]] to-addr . . .
       mailx [-BDdeEHiInNRv~] [-T name] [-A account] [-S variable[=value]] -f
              [name]
       mailx [-BDdeEinNRv~] [-A account] [-S variable[=value]] [-u user]
You want to use the "-S" option, which is only in the third entry. Yet you used the "-s" at the beginning, which is ONLY on the first entry.

Using "-s" does not allow for the use of "-S".

I THINK (not certain though) you have to include the "Subject:" header as part of the body of your message if you are going to be using the "-S" form.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP newbie queries: #< #5.3.5 SMTP; 553 5.3.5 system config error> #SMTP# LYC Linux - Newbie 0 12-04-2014 12:45 AM
Mailx smtp connection problem daraja Linux - Software 2 03-14-2013 05:27 AM
nail.rc/mailx problem, unexpected EOF on smtp connection? trey85stang Linux - Server 1 04-29-2009 07:34 PM
mailx how add ISP as SMTP Shwick Linux - Software 5 10-04-2008 01:07 PM
Syntax using nail (mailx) for smtp without postfix or sendmail Casey Linux - Server 2 06-12-2007 01:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration