-
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.
-
-
Mmm, mail() is touchy like that. Perhaps try sprintf('From: "%s" <%s>', $name, $email)?
-
-
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?
-
-
I suspect the sprintf() documentation will be more helpful than I would.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks