|
Posted by Jerry Stuckle on 11/06/06 22:47
apasj06 wrote:
> hello everyone:
>
> I am trying to send email via php. I using window XP home edition.
> My mail client is
>
> outlook express. I configured mail client to send email via my aol
> email account.
>
> mail server information: mail account: imap.aol.com
>
> server information: incoming mail: imap.aol.com / port: 143
> outgoing mail: smtp.aol.com / port: 587
>
> I changed php.ini file in order to match my email client setting
> //original setting
> ;SMTP = localhost
> ;smtp_port = 25
>
> //new setting
> SMTP = smtp.aol.com
> smtp_port = 587
>
> No matter which setting I use, I always got this error message
>
> when I test my php file I got following error
> "Warning: mail() [function.mail]: Failed to connect to mailserver at
> "localhost" port 25, verify your "SMTP" and "smtp_port" setting in
> php.ini or use ini_set() in C:\Program Files\Apache
> Group\Apache2\htdocs\exer\chapter5\phpemail.php on line 28"
>
> I test my connection to localhost port25 by issuing following command
> in dos prompt:
> telnet localhost 25
>
> I got error message:
> Connecting To localhost...Could not open connection to the host, on
> port 25: Connect failed
>
> <?php
> $from = "mike <name@aol.com>";
> $to = "name@yahoo.com";
>
> $subject = "Agenda for tomorrow's metting";
>
> $message ="In tomorrow's meeting, we will discuss our new marketing
> campaign and
> third-quarter sales results.";
>
> $headers = "From: $from";
>
> $messageSend = mail($to, $subject, $message, $headers);
>
> if($messageSend)
> {
> echo "<p>The following message was send successfully:</p><hr />";
> echo "<p>from: $from</p>";
> echo "<p>to: $to</p>";
> echo "<p>subject: $subject;</p>";
> echo "<p>message: $message</p>";
>
> }
>
> else
> echo "<p>the message was not send successfully!</p>";
> ?>
>
> --Please give me some suggestion on how to configure my php.ini file
> and mail client so I can send email via php script. Thanks in advanced
>
> Jeff
> 11-5-06
>
Jeff,
Are you sure you're changing the correct php.ini file? What does
phpinfo() tell you?
Also - does your smtp server require authorization? If so, you'll have
to authorize yourself before sending the mail.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|