Anyone please help me?

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA

Sun Jan 29, 2012 6:55 pm

Ok, for one thing you can't run the code like this. Try using a function instead.

Code: Select all

function SendMsg($to)

$mailto = $to;
$subject = 'Your new account';
$message = 'A new account has been setup. We look forward to serving your investment needs.';
$message .= "\r\nUsername: ";
$message .= $newusername;
$message .= "\r\n";
$header = "From:"."\r\n";
$header .= "Reply-To:"."\r\n";
$header .= "MIME-Version: 1.0"."\r\n";
$header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
$header .= "Content-Transfer-Encoding: 8bit"."\r\n";
$header .= "X-Mailer: PHP v".phpversion();

mail ($mailto, $subject, $body, $headers);

To use this function you would do some thing this.

Code: Select all

// or send another

Post Reply