Automation Email Script

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
sal399
Forum Newbie
Posts: 1
Joined: Wed Aug 05, 2009 6:28 pm

Automation Email Script

Post by sal399 »

Whenever the client receives the email the also receive the '\n's as well example:
\nDear fadsfasd,\n\nThe password for your account (misfit399)\n has been changed to: giving^cop\n\nSincerely,
I don't know what I'm doing wrong.....thanks for any help in advance!!!!

// password retrieval email function ///////////////////////////////////////////

function send_mail_forgot($sendto, $first_name, $login, $newpsswd){
global $CFG, $language;
$subject = 'Account Update';
$body = 'The password for your account ('.filter_in($login).')';
$body .= '\n has been changed to: '.$newpsswd;
$message .= '\n'.$language['EMAIL_SALUTATION'].' '.filter_in($first_name).',\n\n'.
$body .='\n\n'.$language['EMAIL_SIGNATURE'].'\n';
$from = 'From: '.$CFG->site['contact_email'];
return @mail($sendto, $subject, $message, $from);
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Automation Email Script

Post by jayshields »

New lines are only interpreted properly if they are enclosed in double quotes.

Code: Select all

$str = "This is line 1.\n\nThis is line 3";
Post Reply