Results 1 to 4 of 4

Thread: Mail Function problem/question...

  1. #1
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Mail Function problem/question...

    Basically I had a (PHP) contact form on my website which worked fine, but then I transfered the website to another server and it stopped working.

    So I started breaking it down and trying to find the problem. There seems to be a conflict with headers, specifically the From part, the script wont run when there is a name addition to the email like this: "From: $name <$email>", but if I change it to this: "From: $email", then it works fine.

    It seems like there is nothing wrong with the code since it worked well before on the previous server, so is it possible that the PHP server/software needs to be configured? I am now running on a newer PHP version, could it be that the syntax has changed?

    Also I had the script send me the users IP address and some other information that doesnt seem to work anymore either.

    Anyway I need some information on this, I would be very thankfull if someone who knows could help me out and explaine this.


    Thanks in advance.




    Alex.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Mmm, mail() is touchy like that. Perhaps try sprintf('From: "&#37;s" <%s>', $name, $email)?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Twey,

    I am still learning PHP and dont know some things, could you explain more on what this code you posted does and how to modify it?

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I suspect the sprintf() documentation will be more helpful than I would.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •