Forum Moderators: coopster & phranque

Message Too Old, No Replies

Equivalent of PHP's mail() function

         

iceman22

7:14 am on May 14, 2005 (gmt 0)

10+ Year Member



Using mail() in PHP seems to have become broken, with only emails with a recipients of *@mydomain.com being actually received. My ISP is not responding to support emails, so I would like to see if the problem extends to Perl.

I do not have much Perl experience, I'm just looking to send an email. I don't think there is an easy method of doing this in Perl as in PHP.

I've always been confused by sendmail and postfix and all of that. I would also like to be able to send an email from the shell, I've been unsuccessful in the past attempting that.

Thanks.

iceman22

2:48 pm on May 14, 2005 (gmt 0)

10+ Year Member



I accidently stumbled on an example, and figured it out:

open ( MAIL,"¦/usr/sbin/sendmail -t");
print MAIL "To: myname\@myaddress.com\n" ;
print MAIL "From: notify\@somedomain.com\n" ;
print MAIL "Subject: Comments\n\n" ;
print MAIL "What a message!" ;
close ( MAIL ) ;

In Perl I can send to any recipient, strangely in PHP I can only send emails to my domain, as of a few months ago.