Question : PHP - mail function does NOT work on Window account.  Need Help Sending Mail Using SMTP

PHP: Need Help Sending Mail Using SMTP

Hello Mr.Expert.

Could you please advise how to send email by using PHP mail function?

I have PHP webpage on Window account which is running PHP 5.2 version.
I am using simple PHP mail function ( please see code below).

   $headers  = "From: $from\r\n";
   $headers  .= 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-Type: text/html; charset="iso-8859-1"';
    $success = mail($to, $subject, $message, $headers);

And I recieved Error message on webpage as below:

Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\3791935\html\promo\posted.php on line 180

I spent hours trying to find the answer in vain.
I have no clue how to solve this problem.
Please advise. Please see attached code.

Thank you. Thank you.

Note:
I tried this code below as well: It does not work either.

    $headers  = "From: $from\n";
    $headers  .= 'MIME-Version: 1.0' . "\n";
    $headers .= 'Content-Type: text/html; charset="iso-8859-1"';
    $success = mail($to, $subject, $message, $headers);



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
This is full code that does NOT work on Window account.
But  THIS CODE does WORK on Unix account.

       $to = $sent_email       . ', ';             
      $to .= '[email protected]';
      $from = "[email protected]"; 
      $subject = "Thank you for purchasing our product"; 
      $message .=  nl2br(" \n  ") ;      
      $message .=  nl2br(" \n  ") ;
      $message .=  "\n";
      $message .=  "Hello " . $sent_name . "!    ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "Thank you for purchasing our product. ";
      $message .=  nl2br(" \n  ") ;                                     
      $message .=  "Your password is set to be " . $generated_Password . " and please log in at the following link."  ;
      $message .=  nl2br(" \n  ") ;
      $message .=  "Thank You." ;
      $message .=  nl2br(" \n  ") ;
      $message .=  nl2br(" \n  ") ;
      $message .=  "http://saleNow.com/promo/log-in.php";
      $message .=  nl2br(" \n  ") ;
      $message .=  nl2br(" \n  ") ;
      $message .=  "\n";
      $message .=  "The submitted Data are as follows: - ";      
      $message .=  nl2br(" \n  ") ;
      $message .=  nl2br(" \n  ") ;
      $message .=  "(1) Name: " . $sent_name . ",  ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "(2) Company: " . $sent_company . ",  ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "(3) Address: ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "" . $sent_address .", ";
      $message .=  nl2br(" \n  ") ;
      $message .=  " " . $sent_city . ", " . $sent_state . " " . $sent_zip .  " ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "(4) Email: " . $sent_email .", ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "(5) Phone: " . $sent_phone .", ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "\n";
      $message .=  "(6) Date: " . $sent_date .", ";
      $message .=  nl2br(" \n  ") ;
      $message .=  "\n";
      $message .=  "</div> " ;  


  $headers  = "From: $from\r\n"; 
  $headers  .= 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-Type: text/html; charset="iso-8859-1"';
  $success = mail($to, $subject, $message, $headers);

Answer : PHP - mail function does NOT work on Window account.  Need Help Sending Mail Using SMTP

Use this instead
1:
2:
3:
4:
   Dim rs As Recordset
   Set rs = frm.Recordset
   rs.Delete
   rs.Requery
Random Solutions  
 
programming4us programming4us