LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-05-2004, 12:02 PM   #16
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Original Poster
Rep: Reputation: 47

thanks dford

I don't know, what's wrong.
I use the same script and it doesn't send any mails !
I've spend a lot of time about this problem.

greetings
cccc
 
Old 03-05-2004, 12:39 PM   #17
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
Is sendmail running? I tested sending through sendmail directly with this:
Code:
echo 'From: dford1234@metapath.com
To: dford1234@computer.org
Subject: Test
Hi!
Bye!
.' | /usr/sbin/sendmail dford1234@computer.org
Something like this should work. If it doesn't, perhaps you are running qmail or another MTA? Or no MTA at all?

Note: email addresses were altered to not add to my spam load. You can probably figure them out though.
 
Old 03-05-2004, 01:34 PM   #18
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Original Poster
Rep: Reputation: 47
Yes !

this one for example works excellent and sends mail:

Code:
open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL "to:$mail\n";
print MAIL "from:$linux\n";
print MAIL "subject:sendmail test\n";
print MAIL "hi\n\n";
print MAIL "TEST\n\n";
close(MAIL);
}
I don't know if really important, but I use postfix
and the path to postfix is:
/usr/sbin/sendmail
I use this path at all other scripts and it works.

kind regards
cccc
 
Old 03-05-2004, 02:39 PM   #19
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
Hmmm...try something like this instead of the $msg->send(); line:
Code:
$str = $msg->as_string;
open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL $str;
close(MAIL);
This should turn the message into a string and then print that string in the same way your working example does. You may need to tweak this some, but it should work. Again this works on my system, but my system is using a "traditional" sendmail.
 
Old 03-05-2004, 03:10 PM   #20
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Original Poster
Rep: Reputation: 47
I've replaced, but now I have on this new lines errors:

[Fri Mar 5 22:07:47 2004] mail.cgi: Global symbol "$str" requires explicit package name at mail.cgi line 58.
[Fri Mar 5 22:07:47 2004] mail.cgi: Global symbol "$str" requires explicit package name at mail.cgi line 60.
[Fri Mar 5 22:07:47 2004] mail.cgi: Execution of mail.cgi aborted due to compilation errors.
 
Old 03-05-2004, 03:46 PM   #21
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
You might just add:
my $str;

Last edited by dford; 03-05-2004 at 03:47 PM.
 
Old 03-05-2004, 03:59 PM   #22
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Original Poster
Rep: Reputation: 47
thanks for your time and help, but still no mails


Last edited by cccc; 03-10-2004 at 06:49 PM.
 
Old 03-05-2004, 07:19 PM   #23
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
So, just to be clear, when you enter:
Code:
perl mail.cgi /var/log/log.txt
or something similar you get no error messages and no email? It just returns you to a prompt?
 
Old 03-05-2004, 07:47 PM   #24
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Original Poster
Rep: Reputation: 47
Hi

sorry, my mistake the file was not readable.
now it works !

thanks for your time and HELP !
cccc
 
Old 03-05-2004, 07:49 PM   #25
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
You are welcome! Glad it is working now!
 
  


Reply


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
perl send mail code pragti Programming 2 03-17-2006 05:48 PM
Send Mail with Perl Cool_Hand_Luke Programming 2 03-14-2005 09:59 AM
How to send email with attachment using "mail"? jonathanztaub Linux - Software 4 05-10-2004 11:53 AM
I'm looking for a simply perl script to send mail, when ping down cccc Programming 2 01-12-2004 04:36 AM
mail -a would not work to send e-mail attachment saavik Linux - Networking 3 12-18-2003 09:33 AM


All times are GMT -5. The time now is 03:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration