doctorbill
asked on
php send mail
Thsi code works fine for sending email if the "From" field is filled in
It does not work at all if the "From" and "CC" field s are filled in
Could someone please explain:
-------------------------- ---------- ---------- ----
<?php
session_start();
if ($_POST['email']) {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
if ($_POST['cc']) {
$headers .= "Cc: $_POST[cc]" . "\r\n";
}
$email_to = $_POST['email'];
$subject = "Support Links from TickTockIT";
$headers .= 'From: Tick Tock IT <info@ticktockit.net>' . "\r\n";
ob_start();
include('email-content.php ');
$message = ob_get_contents();
ob_end_clean();
mail($email_to, $subject, $message, $headers);
$_SESSION['sent'] = 1;
header('Location: send-email_b.php'); die;
}
?>
-------------------------- ---------- ---
It does not work at all if the "From" and "CC" field s are filled in
Could someone please explain:
--------------------------
<?php
session_start();
if ($_POST['email']) {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
if ($_POST['cc']) {
$headers .= "Cc: $_POST[cc]" . "\r\n";
}
$email_to = $_POST['email'];
$subject = "Support Links from TickTockIT";
$headers .= 'From: Tick Tock IT <info@ticktockit.net>' . "\r\n";
ob_start();
include('email-content.php
$message = ob_get_contents();
ob_end_clean();
mail($email_to, $subject, $message, $headers);
$_SESSION['sent'] = 1;
header('Location: send-email_b.php'); die;
}
?>
--------------------------
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If the "From" email firld is filled in then the email is sent
If the "From" email field and the "CC" email field are both filled in then nothing is sent
No error message - the script runs and the "your message has been sent" is displayed on my screen
I have attached the full page below
send-email-b.php
If the "From" email field and the "CC" email field are both filled in then nothing is sent
No error message - the script runs and the "your message has been sent" is displayed on my screen
I have attached the full page below
send-email-b.php
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used your code bbut with my email address
Still the same problem
Could this be a php.ini config issue ?
Still the same problem
Could this be a php.ini config issue ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It is working now
It looks as if one of the cc email address I was using was not being recognised correctly
Thanks all
It looks as if one of the cc email address I was using was not being recognised correctly
Thanks all
ASKER
I've requested that this question be closed as follows:
Accepted answer: 125 points for Dave Baldwin's comment #a40694106
Assisted answer: 125 points for Dave Baldwin's comment #a40694076
Assisted answer: 125 points for Ray Paseur's comment #a40694098
Assisted answer: 0 points for doctorbill's comment #a40694121
Assisted answer: 125 points for Dave Baldwin's comment #a40694127
for the following reason:
Solution
Accepted answer: 125 points for Dave Baldwin's comment #a40694106
Assisted answer: 125 points for Dave Baldwin's comment #a40694076
Assisted answer: 125 points for Ray Paseur's comment #a40694098
Assisted answer: 0 points for doctorbill's comment #a40694121
Assisted answer: 125 points for Dave Baldwin's comment #a40694127
for the following reason:
Solution
ASKER
Solution
ASKER
Same problem