| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Mar 2006
9 posts
Gave thanks: 0
Thanked 0 times
|
PHP mail() failing to send, sometimes?
Hello Everyone,
Trying to write up a process to send a welcome mail to new users, but it seems the mail does not work for 'beyond server' addresses. Meaning if I enter a domain I control, on the same server as the mail() page, I get the mail. I send it to an outside domain/server( yahoo.com, or live.com, etc), no message recieved. It's like the mail can't leave the server.Anyone else seeing this, or know how to tweak it to work? thx, tom |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Comfy Contributor
Joined in Sep 2007
Lives in ~root
111 posts
Gave thanks: 1
Thanked 12 times
|
First, confirm that php mail is working by using the most basic test script possible and nothing else on the page.
PHP Mail If that goes through then we know it is your coding or a conflict somewhere within. If it doesn't then you need to do a ticket so the admins can go through mail logs to see what is going on, if it is leaving the server, or if php needs a recompile(99% of the time it isn't the case. Just be sure you give them all the info like the URL to duplicate the problem, email you are sending to, etc.
__________________
I'm proud to say I never have and never will use vista |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Mar 2006
9 posts
Gave thanks: 0
Thanked 0 times
|
I used one even simplier:
mail('someone AnotherDomain.com', 'the subject', 'the message', null,'NoReply xyz.com');Tried this morning, no joy. Like I said, I can send to email addresses that exist on the server, but if they get forwarded, or send directly out, they die. Anyone else? thx, |
|
|
|
|
|
#5 (permalink) | |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
934 posts
Gave thanks: 2
Thanked 94 times
|
Quote:
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|
|
|
|
#6 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Mar 2006
9 posts
Gave thanks: 0
Thanked 0 times
|
Code:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
I tried this version(modified, with my information). Nothing. tom Last edited by TommyD; May 27th, 2008 at 10:51 AM. |
|
|
|
|
|
#7 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Mar 2006
9 posts
Gave thanks: 0
Thanked 0 times
|
I have a reply to a ticket I submitted, I have no 'sender'?
Can someone clarify this? This is my latest test example: Code:
$to = 'outsideemailaccount@anotherdomain.com'; $from = 'webmaster@example.com'; $subject = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n". 'Reply-To: webmaster@example.com'. "\r\n". 'Return-Path: webmaster@example.com' . "\r\n". 'X-Mailer: PHP/' . phpversion(); $message = "test123"; $rs = mail($to, $subject, $message, $headers, "-f ".$from); tom |
|
|
|