sendmail

Paul Lemmons paul.lemmons at tmcaz.com
Tue Jun 13 17:05:53 UTC 2006


On Tuesday 13 June 2006 08:20, Jacob wrote:
> Okay, I'm clueless. I want to use sendmail in conjunction with PHP but I
> have no idea what to do. Right now I'm on FC 5, and behind a NAT (I
> think is what it's called?) and whenever PHP tries to send something it
> comes back with timeout errors.
>
> Any help would be appreciated.
>
> (If its important: I'm using no-ip.com's dynamic DNS services. . . )
>
> Thanks,
> Jacob

I do this all of the time, what package are you using? I have used phpmailer 
with great success. Here is a code snippet that works for me:

http://phpmailer.sourceforge.net/

<?php
require("../phpmailer/class.phpmailer.php");

$html = "<html><body><h1>Hello World!</h1></body></html>";

$mail = new PHPMailer();

$mail->IsHTML(true);
$mail->IsSMTP();                          // telling the class to use SMTP
$mail->Host      = "mail.yourdomain.com"; // SMTP server (sendmail)
$mail->From      = "TestMessage at yourdomain.com";
$mail->FromName  = "Test Message";
$mail->AddAddress("you at yourdomain.com");
$mail->AddAddress("youtoo at yourdomain.com");
$mail->AddCC("me at mydomain.com");
$mail->AddCC("metoo at mydomain.com");
$mail->Subject = "Printer Request for $System";
$mail->Body = $html;

if(!$mail->Send())
{
   print "<html><body>";
   print "Message was not sent<br>";
   print "Mailer Error: " . $mail->ErrorInfo;
   print "</body></html>";
}
else
{
   print "<html><body><h1>Message Sent</h1></body></html>";
}




More information about the fedora-list mailing list