|
Posted by Rajendran on 05/30/07 11:41
On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Rajendran wrote:
> > I want to send mail through PHP using the MS Exchange server.
> > My php.ini file looks like this (for the MAIL functions)
> > -------
> > [mail function]
> > ; For Win32 only.
> > SMTP = exchgserver.test.com
> > smtp_port = 25
>
> > ; For Win32 only.
> > sendmail_from = thegood...@test.com
> > -------
> > The following extensions have been loaded as well.
> > extension=php_imap.dll
> > extension=php_ldap.dll
> > After making these changes there were no errors/warnings. But I'm
> > unable to send any mails.
> > What are the other changes that i should do to send mails?
>
> Do you actually have host exchgserver.test.com? What happens if you try
> to ping it from your command line?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
When I try to ping that server it says "Request Time out"
I've configured my outlook with this server and I'm using it to send
and receive mails.
<?php
//change this to your email.
$to = "raj@yahoo.com";
$from = "raj@test.com";
$subject = "Hello! This is HTML email";
//begin message
$message = <<<EOF
<html>
<body bgcolor="#DCEEFC">
<center>
<b>Looool!!! I am reciving HTML email......</b> <br>
<font color="red">Thanks!</font> <br>
<a href="http://www.gmail.com/">Gmail</a>
</center>
<br><br>*** Now you Can send HTML Email through PHP<br>
Regards<br>Rajen
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to, $from"; // this will send to both emails at the same
time.
// now lets send the email.
$mail_sent = @mail($to, $subject, $message, $headers);
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
That is the php script which i copied from phpfreaks.com
Navigation:
[Reply to this message]
|