Jump to content

Sending Mail


vbnullchar

Recommended Posts

why is it im receiving 3 emails eveytime i run this script? is there something wrong with the codes?

[code]
                $employee = new cEmployee();
$employee_details = $employee->getDetails($empid);

$strQuery = "SELECT email, sup_id, raw_name FROM employees WHERE id='".$employee_details['sup_id']."'";
$result = $mysql->query($strQuery);
$row = $mysql->fetch_array($result);
$mysql->free_result($result);

$to  = $employee_details['email'];

$subject = 'Email';

$message  = 'email content';
$message = wordwrap($message,70);

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= "To: $employee_details[raw_name] <$employee_details[email]>\r\n";
$headers .= "From: Emailer \r\n";
$headers .= "Cc: $employee_details[email] \r\n";

if(!mail($to, $subject, $message, $headers)){
die('error sending mail');
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/27944-sending-mail/
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.