Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I can not make this work:
I can send email from bash with this script:
#!/bin/bash
echo "Test message" | /usr/bin/mail -s "test2" "myEmail@yahoo.com"
When I am trying to run this in Perl using system function like this:
#!/usr/bin/perl
system("'Test message' | /usr/bin/mail -s 'test2' 'myEmail@yahoo.com');
I get message that program exited with code 0 , which is nice, but mail does not get to destination. Any idea what is wrong?? Can I do it in that way??
Thanks
Robert
ps Ubuntu 10 on the machine that I tried the script
What happens when you try executing that command from the command line (as opposed to a perl script)? Try enabling debugging in the command from the perl script to see what happens (--debug-level).
Hello,
I can not make this work:
I can send email from bash with this script:
#!/bin/bash
echo "Test message" | /usr/bin/mail -s "test2" "myEmail@yahoo.com"
When I am trying to run this in Perl using system function like this:
#!/usr/bin/perl
system("'Test message' | /usr/bin/mail -s 'test2' 'myEmail@yahoo.com');
I get message that program exited with code 0 , which is nice, but mail does not get to destination. Any idea what is wrong?? Can I do it in that way??
Thanks
Robert
ps Ubuntu 10 on the machine that I tried the script
Check your logs ... /var/log, and grep for the recipient.
from the command line:
$ sudo aptitude install sendemail
fill in the name / message (from file is OK) / SMTP server (TLS is OK)... and you're up and running.
Detailed instructions can be found at the URL or via the man(ual) file.
$ man sendemail
Good luck. Versions are also available for Winblows (98-XP, probably untested on Vista/W7) and OSX. A careful examination of the Linux script might tell you quite a lot about how e-mail sending works.
Hello,
I can not make this work:
I can send email from bash with this script:
#!/bin/bash
echo "Test message" | /usr/bin/mail -s "test2" "myEmail@yahoo.com"
When I am trying to run this in Perl using system function like this:
#!/usr/bin/perl
system("'Test message' | /usr/bin/mail -s 'test2' 'myEmail@yahoo.com');
I get message that program exited with code 0 , which is nice, but mail does not get to destination. Any idea what is wrong?? Can I do it in that way??
Thanks
Robert
ps Ubuntu 10 on the machine that I tried the script
Last edited by zjoske; 01-17-2011 at 09:10 AM.
Reason: error in statement
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.