Re: Sending mail through another (SMTP authenticated) host
| From: | Haydar TUNA | Date: | Mon, 02 Apr 2007 19:31:58 +0000 |
| Subject: | Re: Sending mail through another (SMTP authenticated) host | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251949@lists.php.net to get a copy of this message | ||
Hello,
You can use phpmailer from http://phpmailer.sourceforge.net/ web
adress:) . You can use examples like this:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "post.somehost.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "somebady"; // SMTP username
$mail->Password = "somepass"; // SMTP password
$mail->CharSet = "iso-8859-9";
$mail->From = "somebady@some.edu.tr";
$mail->FromName = "Mailer";
$mail->AddAddress("somebady@hotmail.com","Name Surname");
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "Subject";
$mail->Body = "Fýstýkçý Þahap";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
""Mário Gamito"" <mgamito@telbit.pt>, haber iletisinde sunlari
yazdi:4610D9F9.5080507@telbit.pt...
> Hi,
>
> How can i use the mail function to send messages through another server
> that has authenticated SMTP ?
>
> Any help would be appreciated.
>
> Warm Regards
> --
> :wq! Mário Gamito