witham Posted August 2, 2006 Share Posted August 2, 2006 Could anybody please tell me how you activate smtp within the xampp for windows? Link to comment https://forums.phpfreaks.com/topic/16359-activating-smtp/ Share on other sites More sharing options...
tomfmason Posted August 3, 2006 Share Posted August 3, 2006 do you mean setting up mecury mail or sending mail via php.If you mean sending mail via php then use the piece of code.[code=php:0]$knowsender = "[email protected]";//must be a username known to the mail serverif ($ccaddress=="" || $ccaddress==" ") { $header="From: $knownsender"; }else{ $header .="From: $knownsender\r\n"; $header .=" Cc: $ccaddress";}// $header.="Bcc: $bcaddress";if (mail($mailtos, $subject, $message, $header)) { echo "success"; include("contact.php");}else{ echo "Your error"; include("contact.php"); }?>[/code]If you have configured the server right then you shouldn't have to change anything in the php.ini or httpd.conf. Just use this piece of code instead of the standard x-mailer format.There is one draw back to this. You cannot send the mail with any additional headers(html mail). It will only work for text Link to comment https://forums.phpfreaks.com/topic/16359-activating-smtp/#findComment-68341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.