www.webdeveloper.com
Results 1 to 4 of 4

Thread: php mail function

  1. #1
    Join Date
    Sep 2008
    Location
    Sarasota, Florida
    Posts
    99

    php mail function

    Mail is not delivered to the recipient.

    "Message successfull sent!" is printed to the screen along with the form data, but the data is NOT delivered by emaill to the recipient.

    What would cause this to fail? What should I be looking to correct?




    if (mail($recipient, $subject, $msg, $header)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); }

  2. #2
    Join Date
    Jun 2008
    Posts
    35
    This is a little bit difficult to answer without knowing what some of the values are for $header etc.

    As stated in the php manual for the mail function "Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination."

    I would start by checking that the recipient and from email addresses are set, are valid and exist.

  3. #3
    Join Date
    Sep 2008
    Location
    Sarasota, Florida
    Posts
    99
    Here's what I did. I replaced $recipient with the actual email addrerss. Not only was the data delivererd, but ALL 10 previous attempts were suddenly there in my mailbox.


    I am not convinced that it will continue to work.

  4. #4
    Join Date
    Mar 2011
    Posts
    1,133
    Email is not always sent or received instantaneously. In fact, it seems that it's getting rarer all the time for Email to arrive within several minutes. The server on either end could be so busy that it has to cache the Email until it can catch up with the load. So don't be discouraged by this experience.
    Rick Trethewey
    Rainbo Design

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles