This topic is locked
[SOLVED]

 Registration E-mail - From Address modification

9/7/2009 5:22:56 PM
PHPRunner General questions
S
salus1 authorDevClub member

Hi,

Does anyone know how to change the sender address in registration verification e-mail messages?

I read how to do it before in this forum but I can't find that post now.

Thanks!

S
salus1 authorDevClub member 9/8/2009

Hi,

Thanks for this info. Per the post I altered the line in register.php to...
runner_mail(array('to' => $strEmail, 'subject' => "Notification on registering", 'body' => $message, "From: registration@mysite.com\nReply-To: customerservice@managedcreditservices.com\n"));
...but no joy, still receiving registration confirmation message from " Apache (apache@243777-app1.mysite.com) ".
Anyone have any experience adjusting this on a hosted PHP server?

S
salus1 authorDevClub member 9/8/2009

Hi,

I found this post but I think it relates to an earlier version of PHPRunner as the register.php source file in 5.1 is structured diffently.
All you need to do is set extra headers in the code for register.php located in c:\program files\phprunner\source

Find this line

mail($strEmail,##message REGMAIL_USER4##,$message); (THIS LINE DOESN'T EXIST IN 5.1)

and change it to this with your domains email address, keep in mind that remind.php has the same issue so change that one too?!

mail($strEmail,##message REGMAIL_USER4##,$message,"From: David Smith <dsmith@nobody.com>");
Does anyone have the syntax to make this work?

S
salus1 authorDevClub member 9/9/2009

Does anyone know how to change the e-mail address that is used for registration e-mails? By defualt the web server's information is used but this is rarely the adddress you want showing.

Sergey Kornilov admin 9/9/2009

From email address can be set in PHPRunner under Security->User Login settings.
If this doesn't help open ticket at http://support.xlinesoft.com sending your order number, website URL and FTP access info.

S
salus1 authorDevClub member 9/12/2009

Hi Sergei,

Thanks for your reply. I configured the "From email address can be set in PHPRunner under Security->User Login settings" but registration e-mails still come from the server's default address. I can't send you the info you request for security reason (mostly my job security). Any chance that you could send instructions on how to configure this within PHP Runner?

Thanks!

S
swanside 9/13/2009

It would be nice if we all can see this as mine does the same.
Regardless of what you put in the from email address in the phprunner program, it always comes back with the server name and address.

S
salus1 authorDevClub member 9/13/2009

I've got a hunch that the modification needs to be in this section of the register.php file...
// send email to user

$message="You have registered as user at"." ".$url."\r\n\r\n";

$message.= "Click this link to confirm your account and finish the registration".":\r\n";

$message.= $url."?a=activate&u=".rawurlencode(base64_encode($values["UserName"]))."&code=";

$message.=rawurlencode(md5($values["UserName"].md5($values["UserPassword"])));

$message.="\r\n("."If you are unable to click on the link, copy and paste it into your browser window.".")\r\n\r\n";

$strLabel = "User Name";

$message.=$strLabel.": ".$values["UserName"]."\r\n";

$strLabel = "User Password";

$message.=$strLabel.": ".$values["UserPassword"]."\r\n";

$strLabel = "User Email";

$message.=$strLabel.": ".$values["UserEmail"]."\r\n";

if(($pos=strpos($strEmail,"\r"))!==FALSE || ($pos=strpos($strEmail,"\n"))!==FALSE)

$strEmail=substr($strEmail,0,$pos);

runner_mail(array('to' => $strEmail, 'subject' => "Notification on registering", 'body' => $message));
...I just need the correct syntax (duh). I've tried a number of different combinations but no joy. Any ideas?

S
salus1 authorDevClub member 9/13/2009

Hunch confirmed, alter the last line is the send email to user section of register.php to...
// send email to user

$message="You have registered as user at"." ".$url."\r\n\r\n";

$message.= "Click this link to confirm your account and finish the registration".":\r\n";

$message.= $url."?a=activate&u=".rawurlencode(base64_encode($values["UserName"]))."&code=";

$message.=rawurlencode(md5($values["UserName"].md5($values["UserPassword"])));

$message.="\r\n("."If you are unable to click on the link, copy and paste it into your browser window.".")\r\n\r\n";

$strLabel = "User Name";

$message.=$strLabel.": ".$values["UserName"]."\r\n";

$strLabel = "User Password";

$message.=$strLabel.": ".$values["UserPassword"]."\r\n";

$strLabel = "User Email";

$message.=$strLabel.": ".$values["UserEmail"]."\r\n";

if(($pos=strpos($strEmail,"\r"))!==FALSE || ($pos=strpos($strEmail,"\n"))!==FALSE)

$strEmail=substr($strEmail,0,$pos);

runner_mail(array('to' => $strEmail, 'from' => "yourmailaddress@yourdomain.com", 'subject' => "Notification on registering", 'body' => $message));