How to send an email with php? Please Help

Status
Not open for further replies.

creati19

New Member
Messages
18
Reaction score
0
Points
1
Code:
        if ($result) {
        $to = "$sanEmail";
        $subject = "TextDeck - Account Activation";
        $message = "$username, Thanks for registering at <a href='http://textdeck.x10host.com' title='TextDeck'>TextDeck</a>!\n
        To activate your account please use the following link: <a href='http://textdeck.x10host.com/activation.php?username=$username&activation=$textstr'>Text Deck Account Activation</a>";
        $from = "admin@textdeck.x10host.com";
        $headers = "Content-type: text/plain; charset=windows-1251 \r\n";
        $headers .= "From: $from\r\n";
        $headers .= "Reply-To: $from\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "X-Mailer: PHP/" . phpversion();
        mail($to,$subject,$message,$headers);
        echo "Registration Successful, we have just sent an activation email!";
       
        }else{
        echo "Failed to sent email activation code";
        }
Is this right? Can someone please help me, it sends the email but it does not display the right content IE: the email just says: Hello! This is a simple email message.
 

cpo_ca

New Member
Messages
26
Reaction score
0
Points
1
I don't any obvious problem, hmmm.. some recommendations:
-why don;t you use the $sendEmail directly in the mail() function?? (instead of using $to)
-try to send it without all the headers

good luck!
 
Status
Not open for further replies.
Top