LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-06-2013, 02:50 AM   #1
NikosGr
Member
 
Registered: Jun 2013
Posts: 60

Rep: Reputation: 0
Question Trying to send mail form within my python script via mailx and sendmail


i as root just installed
sendmail and mailx. i have edited the ~/.mailrc to use:
nikos@superhost.gr [~/www/cgi-bin]# cat ~/.mailrc
account gmail {
set smtp-use-starttls
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=may)gmail
set smtp-auth-password=my_gmail_pass_not_stupid_enough_to_wite _it_again
}
And now i'm trying to:
cmd = "echo %s | mailx -A gmail -r %s -s %s %s" % (MESSAGE, FROM, SUBJECT, TO)
p=subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE )
output, errors = p.communicate()
print( errors, output )
Any ideas please why this fails to work?
while i remove the '-A gmail' string in the cmd line then i can send fast mail but only to mail containing the @superhost.gr trail.
i need to be eble to send to external mails to.
=============

Even trying it from the shell that is, 'mailx' fails to delivers my test mails.

Can one help me configure sendmail properly?


mailX == an MUA == a Mail Client right?
sendmail == MTA == program that is responsilble to send mails?

So, i gather 'mailx' does use 'sendmail' to send mail yes?

can you provide me a working mail exmaple that works?

Why i can only send mail to local server addresses an not to an external mail address?
 
Old 09-06-2013, 04:08 AM   #2
m_kane
Member
 
Registered: Jan 2009
Posts: 30

Rep: Reputation: 2
I use this from command line:

http://caspian.dotconf.net/menu/Software/SendEmail/

No need to configure anything. Just download it and run.
 
Old 09-06-2013, 04:14 AM   #3
NikosGr
Member
 
Registered: Jun 2013
Posts: 60

Original Poster
Rep: Reputation: 0
Hell,

I need to able to use SendEmail from within my python 'mail.py'script.
Can it be used from there or is it form cmd only?

Please tell me a few things on how to invoke it, thank you.
 
  


Reply

Tags
mailx, python, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] How to send a mail in HTML format using mailx or mail or sendmail commands vishnu_knl Linux - Newbie 8 04-05-2012 11:00 AM
Python script to web form Neruocomp Programming 1 03-24-2011 09:11 AM
How to configure sendmail only to send mail to external mail account Nivix Linux - Newbie 2 10-23-2008 01:46 AM
sendmail: how to send mail from my yahoo e-mail address harryhaller Slackware 3 11-14-2006 12:00 AM
Perl form wont send mail calmbomb Linux - Software 4 11-07-2004 11:08 AM


All times are GMT -5. The time now is 06:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration