Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3660
| From | Newbie |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | email sent from webpage is classed as junk |
| Date | 2011-11-03 17:48 +0000 |
| Organization | NewsGuy - Unlimited Usenet $19.95 |
| Message-ID | <kek5b71den115mpli3tabl45gikmvbv9g1@4ax.com> (permalink) |
Hi folks,
I have built a simple form on my website for people to enter an email
address before downloading a brochure. Every time the brochure is
downloaded I want to send an email to myself to keep track of the
people that have downloaded it. Everything works fine except for the
fact that when I recieve the email it goes straight into my junk email
cos its classed as spam. What can I do to prevent this.
Here is the code I have used
"<?php
$firstname = $_REQUEST['firstname'];
$secondname = $_REQUEST['secondname'];
$email_from = $_REQUEST['email'];
if (empty($firstname)||empty($secondname)||empty($email_from)){
?><h1 align = "center">One or more of the fields on the form has not
been completed.</h1><br>
<p align = "center">Please use the back button on your browser<br>
and complete the form correctly</p>
<?php
}
elseif (filter_var($email_from, FILTER_VALIDATE_EMAIL)) {
ini_set("sendmail_from","myemail@myaddress.co.uk");
$email_to="myemail@myemailaddress.co.uk";
$name=$_REQUEST['firstname']." ".$_REQUEST['secondname'];
$message=$name." has just downloaded the brochure from your website.
Their email address is ".$email_from;
$email_subject="A brochure has been downoaded from your website.";
$headers="From:$email_from.\n";"Reply-To:$email_from.\n";
$sent=mail($email_to,$email_subject,$message,$headers,"-f".$email_from);
if($sent){
header("Location:http://www.mywebsite/pdf/brochure.php");}
else{
echo "Request failed";}
}
else {
?><h1 align = "center">The format of the email address entered is not
correct.</h1><br>
<p align = "center">Please use the back button on your browser<br>
and complete the form correctly</p>
<?php
}
?>"
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
email sent from webpage is classed as junk Newbie - 2011-11-03 17:48 +0000
Re: email sent from webpage is classed as junk Doug Miller <doug_at_milmacdotcom@example.com> - 2011-11-03 13:58 -0400
Re: email sent from webpage is classed as junk Michael Vilain <vilain@NOspamcop.net> - 2011-11-03 11:32 -0700
Re: email sent from webpage is classed as junk Doug Miller <doug_at_milmacdotcom@example.com> - 2011-11-03 16:20 -0400
Re: email sent from webpage is classed as junk Tim Streater <timstreater@greenbee.net> - 2011-11-03 20:04 +0000
Re: email sent from webpage is classed as junk Geoff Muldoon <geoff.muldoon@trap.gmail.com> - 2011-11-04 09:52 +1100
Re: email sent from webpage is classed as junk richard <member@newsguy.com> - 2011-11-03 20:42 -0400
csiph-web