The email funtion on my quick card website does not work. After searching a little I found out that the company where I host my website does accept the mail() function but only if there is a "from header".
Such as:
$headers = "From: me <me@me.com>\n";
Our something like that. So my questions are, What code do I use en Where do I insert this code?
I hope everything is clear, if not please ask me if you need more information.
roelofs88 - if you look in core/other.php to function SendMail you'll find a line @mail( $sTargetEmail, $sTopic, $sMailContent, 'From: '.$sSender ), so the headers are already there ('From: '.$sSender ). You could try to remove @ in front and send a mail again and a error message will pop. Maybe this error message will tell more.
roelofs88
2006-11-09 19:31
I still get the same message, that there was an error. Also I forgot to mention it's about mail on the contact page. The page where users can send email's to me via de webbrowser.
roelofs88 - try http://opensolution.org/Quick.Cart/docs/en/?id=tips, look for mail() function replacement in Contact page
roelofs88
2006-11-10 19:52
It still doesn't work. This is what the hosting company says: (translated
Our application has no changes that have a big impact with the use of the mail() function. It does however need to meet certain requirements:
The message must contain a "from" header. from: name | from: user@domain; The domain that is named in the from header must be known at PCextreme( my hosting company).
If the message does not meet the requirements the mail() function will return FALSE and create a PHP WARNING. The given warning can be suppressed by using the @.
They also give some examples:
<?php
/** * $to : receiver of the message * $subject : subject of the message * $message : contents of the message */ $to = "receiver@domain.nl"; $subject = "php mail() test"; $message = "Text and stuff
/** * Example 1 * * This method will FAIL becaus there * is nog 'from'header */ print (!mail($to, $subject, $message)) ? "FAIL!" : "SUCCESS!"; // FAIL!
/** * Example 2 * * This will fail too because we assume, 'unknown.nl' is not known at PCextreme */ $headers = "From: Anonymous <user@unknown.nl>\n"; $headers .= ""; // add more headers if needed print (!mail($to, $subject, $message, $headers)) ? "FAIL!" : "SUCCESS!"; // FAIL!
/** * Example 3 * * The following will work because * the domain pcextreme.nl is known as a vhost. */ $headers = "From: PCextreme B.V. <support@pcextreme.nl>\n"; $headers .= ""; // voeg meer headers toe indien gewenst print (!mail($to, $subject, $message, $headers)) ? "FAIL!" : "SUCCESS!"; // SUCCESS!
/** *Example 4 * * The following messae will be apporved. * If a sender is known at PCextreme, if a user replies to this message, *the reaction will be sent to user@unknown.nl */ $headers = "From: PCextreme B.V. <support@pcextreme.nl>\n"; $headers .= "Reply-to: user@unknown.nl\n"; print (!mail($to, $subject, $message, $headers)) ? "FAIL!" : "SUCCESS!"; // SUCCESS!
?>
This is all the info I have,
Sorry to keep bothering you but I really need this fixed. So, thanks again,
It doesn't say much, just that there was an error.
minimus
2006-11-11 17:22
Maybe it can be helpful for anyone having problems in emailing from quickcart: please try to change 'FROM: ' into 'From: ' ( function mail(...) in sendOrderStatusToClient, sendOrderToClient ), it solved email header problems in my case (no any error but emails did not arrive to some accounts).
roelofs88
2006-11-12 13:59
It's about the normal contact page, not the email that gets send to the Client when he or she places an order. This might work but where do I insert this code? in other.php? and what code do I use?