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
https://forums.phpfreaks.com/topic/205566-php-mailer/#findComment-1075671
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
https://forums.phpfreaks.com/topic/205566-php-mailer/#findComment-1075783
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
https://forums.phpfreaks.com/topic/205566-php-mailer/#findComment-1075793
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
https://forums.phpfreaks.com/topic/205566-php-mailer/#findComment-1085088
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.