I have the Code to send an HTML based email 2 different ways But noth of them are not working correctly. The first Is CDONTS and i Just need to know where the Line
\nContent-Type: text/html; charset=iso-8859-1
Would go in this code for it to actually WORK?
<?
$mailaddr=${"mailaddr"};
$newuser=${"newuser"};
$strTo=${"frienda"}.";".${"friendb"}.";".${"friendc"}.";".${"friendd"}.";".${"friende"};
$filename = "welcome-msg\welcome.htm";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$contents=str_replace("{{newuser}}",$newuser,$contents);
$contents=str_replace("{{mailaddr}}",$mailaddr,$contents);
// $myMail is of type "CDONTS.NewMail"
$my_email = new COM("CDONTS.NewMail") or die("Could not create an email");
$my_email->from = "Welcome@domain.com";
$my_email->to = $strTo; //Where the message is going
$my_email->subject = $newuser." has a new email address";
$my_email->body = $contents; //The body of the message
$my_email->send(); //sends the email
?>
If your not familliar with the USE of CDONTS then Maybe you can help me with this one.
It Doesnt seem to Send to the TO variable but the above one does.
<?
$mailaddr=${"mailaddr"};
$newuser=${"newuser"};
$strTo=${"frienda"}.";".${"friendb"}.";".${"friendc"}.";".${"friendd"}.";".${"friende"};
$filename = "welcome-msg\welcome.htm";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$contents=str_replace("{{newuser}}",$newuser,$contents);
$contents=str_replace("{{mailaddr}}",$mailaddr,$contents);
mail("$strTo", "Welcome to domain", $contents, "From:welcome@domain.com\nContent-Type: text/html; charset=iso-8859-1");
?>