You are here: Re: Sending a mail through exchange server « PHP Programming Language « IT news, forums, messages
Re: Sending a mail through exchange server

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация