SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email address doesn't receive emails sent using mail()

    Hi,

    Not sure if this is a PHP issue but here is my problem:

    I have a PHP application, coded by myself and distributed for use. A user installed this on a VPS server. In my application, there is a contact form that uses mail() function to send the contact message to the specified email address of that user. That email address is set in a settings file. When I test this contact form with my email (...@yahoo.com), another email (...@live.com) and one other that uses my domain (...@mydomain.com) it works fine, the contact message is sent. However, when the user puts his email which is (...@hisdomain.com), the form doesn't send the message. No errors. What could be the reason for such a behavior? I am guessing that it is something to do with his email but no idea.

    Thanks for any ideas.

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    The problem could be in the sendmail configuration of VPS server. Check mail server's log files to see what's happening there.

  3. #3
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ronalds View Post
    The problem could be in the sendmail configuration of VPS server. Check mail server's log files to see what's happening there.
    Thanks, either there is no mailserver log file on the server or I couldn't find it...

  4. #4
    SitePoint Guru bronze trophy
    Join Date
    Dec 2003
    Location
    Poland
    Posts
    930
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Generally, mail() function in PHP is not very reliable and is not a good idea when message delivery must always work. Use a library for sending mail - either Swiftmailer or PHPMailer - and set it up to send messages via an SMTP account set up by the user, preferrably on the same server. Swiftmailer can also send messages without specifying SMTP - it is slightly better than plain mail(). You could set up your library to use Swiftmailer without SMTP by default and strongly encourage users to create their own SMTP accounts and configure your application to use them. PHPMailer may have a similar feature but I don't remember now.

    mail() has all kinds of issues, depends a lot on server configuration and you will always find someone for whom it is unreliable.

  5. #5
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi please check secure email.php page coding and check contact page coding. I think coding mistake between the pages.


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
  •