SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail() sends email twice

    I've created a contact form and a script which uses the mail() function to email the data entered.

    My script appears to be functioning as I want, but two emails arrive at the destination inbox. The first email is from the default 'nobody' address of the Apache server, and the second email arrives with the correct email headers which I have specified.

    Can anyone help me find why this is happening and how to stop it?

  2. #2
    SitePoint Guru deepM's Avatar
    Join Date
    Dec 2007
    Location
    India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you show us your mail function? so probably we can help you.

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all show your code so that we can see if anything wrong with the code. But since you have said that first email sender is 'nobody' there maybe something wrong with the configurations. So see if you are able to see the apache/php mail sending configurations. Or just try once sending a simple plain mail using mail() function once and see how does it work.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    False alarm. Whilst creating a minimal test case to post here I found my error. A very obvious one!

    There's a tip in there for troubleshooting your own work!

    Thanks everyone.


Tags for this Thread

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
  •