FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » email sent from webpage is classed as junk
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: email sent from webpage is classed as junk [message #175890 is a reply to message #175875] Fri, 04 November 2011 00:42 Go to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
On Thu, 03 Nov 2011 17:48:55 +0000, Newbie wrote:

> 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(at)myaddress(dot)co(dot)uk");
> $email_to="myemail(at)myemailaddress(dot)co(dot)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
> }
> ?>"

One possibility is that your IP is on somebody's black list.
But your mail client should have the option as treating that domain/IP as
"not spam".
Check in your options.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Model Centric PHP Web Framework
Next Topic: sqlite and php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 18:52:57 GMT 2024

Total time taken to generate the page: 0.12717 seconds