FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP mail problems...





Dougie1
Well I have gotten the mail function to work before but I cannot seem to get it to work in this specific code. It has a lot of code before the mail part if that has any effect. Here is the code:

Code:
$message = "http://www.example.com/u/$Folder/attemptedurls.html";

$subject = "Please review.";
$message = "The following was created.  Review it here:

http://www.example.com/u/$Folder/attemptedurls.html";
$from = "webmaster@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
SlowWalkere
You mentioned that there was a lot of code before the mail() call. Have you checked to make sure that it is functioning properly? You might try throwing an echo in the code right before the mail() call, just to make sure that the code is executing that far down.

Also, within the code that you presented, I noticed two problems.

One, you define $message twice. That shouldn't have any effect on whether or not the mail() executes and sends the message, but it is strange.

Two, you never define the $to variable. Presumably you set that earlier in the script. However, if you haven't done so, that would be a very good reason why the code is not working.

If that isn't the problem, perhaps you could give us some more information? At the moment, there's not a lot to go on. Do you get an error message when you run the script? Do you just not receive the e-mail? Does the originating e-mail account get a bounced e-mail?

The actual mail() call seems to be proper to me, so either there's a problem with the mail servers or something is mis-defined in the script.

Good luck,
- Walkere
Related topics
PHP Mail Function
php mail and BCC
PHP mail function ?
Does FriHost support php mail?
Php mail function
Can You Get HTML in Your PHP Mail Script?
PHP Mail
PHP Mail - Always Junked?
PHP mail() Function
SMTP, sendmail e PHP mail function
Mail problems on VPS1
Php mail
Webmail, not PHP Mail, has never worked for me...
php mail(); problem... half fixed?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.