Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   phphq.Net Forums (https://novahq.net/forum/forumdisplay.php?f=277)
-   -   phMailer question (https://novahq.net/forum/showthread.php?t=47254)

Bamboozle 03-28-2013 02:38 PM

phMailer question
 
Hi everyone, first post here, so hello all.

I am trying to adapt the phMailer form so that it sends email from my email address, my host (dreamhost) block any emails that are sent by web pages from a non-dreamhost email address, so I need to make sure it's coming from my email address or it won't work!

I'm guessing this is the line I need to adapt:

Code:

$headers.="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
But with php not being my first spoken language I can't get it to work, any help would be greatly appreciated

Scott 03-29-2013 08:42 AM

You would want to change this:
PHP Code:

        //Headers
        
$headers="Return-Path: <".clean_msg($youremail).">\n";
        
$headers.="From: ".clean_msg($yourname)." <".clean_msg($youremail).">\n";
        
$headers.="X-Mailer: PHP/".phpversion()."\n";
        
$headers.="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
        
$headers.="X-Priority: ".$priority."\n"
        
$headers.="MIME-Version: 1.0\n";
        
$headers.="Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
        
$headers.="This is a multi-part message in MIME format.\n";

        
//Message
        
$message "--".$boundary."\n";
        
$message.="Content-Type: text/html; charset=\"iso-8859-1\"\n";
        
$message.="Content-Transfer-Encoding: quoted-printable\n";
        
$message.="\n";
        
$message.=clean_msg(nl2br(strip_tags($yourmessage)));
        
$message.="\n"

To this:

PHP Code:

        //Headers
        
$headers="Return-Path: <".clean_msg($myemail).">\n";
        
$headers.="From: ".clean_msg($myemail)." <".clean_msg($myemail).">\n";
        
$headers.="X-Mailer: PHP/".phpversion()."\n";
        
$headers.="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
        
$headers.="X-Priority: ".$priority."\n"
        
$headers.="MIME-Version: 1.0\n";
        
$headers.="Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
        
$headers.="This is a multi-part message in MIME format.\n";

        
//Message
        
$message "--".$boundary."\n";
        
$message.="Content-Type: text/html; charset=\"iso-8859-1\"\n";
        
$message.="Content-Transfer-Encoding: quoted-printable\n";
        
$message.="\n";
        
$message.="Name: ".clean_msg(strip_tags($yourname))."<br />";
        
$message.="Email: ".clean_msg(strip_tags($youremail))."<br />";
        
$message.="<br />";
        
$message.=clean_msg(nl2br(strip_tags($yourmessage)));
        
$message.="\n"


Bamboozle 03-30-2013 04:43 PM

Brilliant, thank you Scott


All times are GMT -5. The time now is 07:22 AM.

Powered by vBulletin®