Advanced Search

Results 1 to 2 of 2

Thread: Warning: mail() [function.mail]: SMTP server response: 503 RCPT first (#5.5.1)

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Warning: mail() [function.mail]: SMTP server response: 503 RCPT first (#5.5.1)

    Hi,

    I have mail function but when I send it it appears to me as warning message like this

    Warning: mail() [function.mail]: SMTP server response: 503 RCPT first (#5.5.1) in D:\Hosting\3181178\html\goldy\Bay\includes\functions.php on line 51
    My php coding is like this
    PHP Code:
            $subject    =    "Notice about reservation cancel";
            
    $body         "<html>\n";
            
    $body         .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n";
            
    $body         .= "Notice about reservation cancel on Bay Airporter Express Inc";
            
    $body         .= "Your reservation is cancelled
                                    Reservation Number : "
    .$res_num."";
            
    $body         .= "</body>\n";
            
    $body         .= "</html>\n";
            
            
    $headers      "From: Admin<admin@baei.com>\r\n";
            
    $headers     .= "Reply-To: webmaster@baei.com\r\n";
            
    $headers     .= "Return-Path: webmaster@baei.com\r\n";
            
    $headers     .= "MIME-Version: 1.0\r\n";
            
    $headers     .= "Content-type: text/html; charset=iso-8859-1\r\n";
            
            
    mail($email$subject$body$headers); 
    If any help would be great!

    Cheers!!!

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    503 is a bad sequence error. Usually means something isn't complete or is in a wrong order.

    The one thing I noticed is there is no "to" so the script doesn't know who to send the email to. You are also using $email, which isn't defined anywhere.

    If you are using extra headers you should probably use X-Mailer. It looks something like this:

    PHP Code:
    <?php

    $to 
    "recipient@example.com";

    $subject "Hi!";

    $body "Hi,\n\nHow are you?";

    $headers "From: sender@example.com\r\n" .

        
    "X-Mailer: php";

    if (
    mail($to$subject$body$headers)) {

      echo(
    "<p>Message sent!</p>");

     } else {

      echo(
    "<p>Message delivery failed...</p>");

     }

    ?>
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •