Jump to content

php mailer


flemingmike

Recommended Posts

ok, so im starting with this, and im getting error on line 9.

 

<?php
$to      = 'email@rogers.com';
$subject = 'Email From Website';
$message = 'hello';
$headers = 'From: mike@email.ca' . "\r\n" .
    'Reply-To: mike@email.ca' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 

 

any ideas?

Link to comment
Share on other sites

ive never tried setting headers in a single variable, try doing it in multiple like:

 

$headers = 'From: mike@email.ca\r\n'

$headers .= 'Reply-To: mike@email.ca\r\n'

$headers .= 'X-Mailer: PHP/' . phpversion().'\r\n';

 

and see if that works... 

Link to comment
Share on other sites

here is my current code:

 

<?php
$to      = '****@rogers.com';
$subject = 'Email From Website';
$message = 'hello';
$headers = 'From: mike@****.ca\r\n'
$headers .= 'Reply-To: mike@****.ca\r\n'
$headers .= 'X-Mailer: PHP/' . phpversion().'\r\n';



mail($to, $subject, $message, $headers);
?> 

Link to comment
Share on other sites

radar, i saw your other postings on the add cc to email, so im trying that.  here is my alternate code:

 

<?php

$email = $_POST['Email1'];
$name = $_POST['FirstName1'] $_POST['LastName1'];
$mailto = 'mike@*****.ca';
$mailsubj = "Email From Website";
$mailhead .= "FROM: ".$name;
$mailhead .= "Reply-To: ".$email;
$mailhead .= "CC: ".$email;


$mailbody = "Values submitted from LOI:\n";
while (list($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $val\n";

}

mail($mailto, $mailsubj, $mailbody, $mailhead);



?>

 

 

 

im getting this error:

 

Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in E:\Website\dance\registration.php on line 18

 

any ideas?

Link to comment
Share on other sites

  • 3 weeks later...

Often times, the mail function has issues in a localhost setting.  I've had the same thing happen to me but the moment I upload it to live server, it works perfectly.  mail functions are hard to figure out sometimes...    but my suggestion is to try it on your live server, and not on the local host server and see what that says to you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.