Configuration problem with PHP SMTP Server

the mail() function

Moderators: macek, egami, gesf

mrmasad
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Sep 12, 2011 1:51 am

Configuration problem with PHP SMTP Server

Postby mrmasad » Mon Sep 12, 2011 1:58 am

Hi,
I am using "PHP SMTP Server for Windows 1.0 by Hadi Fanaee" , I am trying to send mail from localhost. Here is my php.ini settings.
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
My mail.php file having following code:-
$to = "mrmasad@hotmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
mail($to, $subject, $body);
______________________
But I am having php warning i.e. "SMTP server response: 525 can not connect to "hotmail.com" ! in C:\wamp\www\mail\mail.php on line 11
".
Can Anyone help me.

User avatar
bigjoe11a
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA
Contact:

Re: Configuration problem with PHP SMTP Server

Postby bigjoe11a » Tue Sep 27, 2011 8:10 pm

Code: Select all

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest