Re: sendmail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx";
$mail->FromName  = "Test Message";
$mail->AddAddress("you@xxxxxxxxxxxxxx");
$mail->AddAddress("youtoo@xxxxxxxxxxxxxx");
$mail->AddCC("me@xxxxxxxxxxxx");
$mail->AddCC("metoo@xxxxxxxxxxxx");
$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>";
}

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux