Jump to content

Recommended Posts

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 = "you@yourdomain.com";//must be a username known to the mail server
if ($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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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