/    Sign up×
Community /Pin to ProfileBookmark

PHP Form Email?

This is driving me crazy!

I’m trying to make a simple page send me an email, but when I execute the script, it appears as though the email has sent on the page, but I never get the email. I’ve checked spam and other filters, but I can’t find a reason on the email end… anything on the PHP end that would cause the page to act as though it had sent but actually hadn’t?

Anything you got is great and definately more than I do…

[CODE] <?php
if(isset($send))
{
$body = “The following entry is for the “How Well do You Know Woodstock” ad from:nnName:n”.$_POST[‘name’].”nAddress:n”.$_POST[‘add1’].”, “.$_POST[‘add2’].”,n “.$_POST[‘city’].”, “.$_POST[‘state’].” “.$_POST[‘zip’].”nPhone:n”.$_POST[‘phone’].”nn””.$_POST[‘what’].”,n”.$_POST[‘where’].””n”;

$from = “FROM: [email protected]
.”rnX-MSMail-Priority: High”
.”rnX-Mailer: Microsoft Outlook Express 6.00.2900.2180″
.”rnX-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180″
.”rnContent-type: text/html; charset=iso-8859-1rn”;

$to = “[email protected]”;
$subject = “Online HWDYKW Submission”;

if(mail($to, $subject, $body, $from))
{echo “Thank you! Your entry has been sent.”;}
else{
echo “Oops…”;
}
}
else{}
?>[/CODE]

The button works and so does PHP.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bejitto101Oct 31.2008 — I don't see anything off the bat, but have you tried sending an email with a simple subject?

Another idea would be to remove all those additional headers, except the from and see if that makes a difference.

On another hand, it seems that the window line breaks "rn" could be an issue. Try just "n".

From php.net:
Note: If messages are not received, try using a LF (n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with &#187; RFC 2822.[/QUOTE]

http://michaelkrol.com/2005/12/07/php-mail-and-gmail-a-warning-on-headers/
×

Success!

Help @dz_boy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...