Free Web Hosting Forum
(#1)
Old
merlieon merlieon is offline
Junior Member
merlieon is on a distinguished road
 
Posts: 10
Join Date: Mar 2013
Default mail(); dosent work! - 03-19-2013, 06:03 PM

Hello i am trying to use the mail() function to send a basic mail (just to test so it work) but the thing is that i am not getting any errors but i dont get the mail :S

here's the code
PHP Code:
<?php
$to      
'merlieon@hotmail.com';
$subject 'the subject';
$message 'hello';
$headers 'From: [email]webmaster@example.com[/email]' "\r\n" .
    
'Reply-To: [email]webmaster@example.com[/email]' "\r\n" .
    
'X-Mailer: PHP/' phpversion();

mail($to$subject$message$headers);
?>
what could be wrong??

Last edited by d3iti; 03-21-2013 at 06:59 AM. Reason: [php] tags added
Reply With Quote
(#2)
Old
grace1004 grace1004 is offline
Senior Member
grace1004 is on a distinguished road
 
Posts: 890
Join Date: Dec 2010
Default 03-21-2013, 01:37 AM

Tested your code on 000webhost.com server29, and it works fine.
I changed your code as shown below. After testing the following
code, if you get "Success" message, mail() function is working
normally.

PHP Code:
<?php
$to 
'merlieon@hotmail.com';
$subject 'the subject';
$message 'hello';
$headers 'From: webmaster@example.com' "\r\n" .
'Reply-To: webmaster@example.com' "\r\n" .
'X-Mailer: PHP/' phpversion();

$success mail($to$subject$message$headers);
if (
$success){
echo 
"Success";
} else {
echo 
"Sorry error please try again..."
}
?>
In case you do not receive the mail even though you got "Success" message,
hotmail.com might be blocking the email from 000webhost.com server.
In the past, when I tested mail sending from 000webhost.com server to
3 local email addresses of mine, I received 2 emails only, which means
one email is blocked.
Reply With Quote
(#3)
Old
merlieon merlieon is offline
Junior Member
merlieon is on a distinguished road
 
Posts: 10
Join Date: Mar 2013
Default still not working - 03-21-2013, 07:40 AM

i did try this code now, and well i'll tried with gmail.com,hotmail.com and yahoo.com and non of them works. it do success but no mail come, so which mails did you try with? and which mails shall work in 000webhost..

I think that all mails should work:S

<!DOCTYPE html>
<html>
<body>
<?php
$to = 'merlieon95@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

$success = mail($to, $subject, $message, $headers);
if ($success){
echo "Success";
} else {
echo "Sorry error please try again...";
}
?>
</body>
</html>
Reply With Quote
(#4)
Old
ShocK's Avatar
ShocK ShocK is offline
Senior Member
ShocK is on a distinguished road
 
Posts: 5,474
Join Date: Jul 2011
Location: UK
Default 03-21-2013, 08:51 AM

This maybe of interest to you - http://www.free-installations.info/t...53/#post-28415

http://server29.000webhost.com/mailtest.php
Reply With Quote
(#5)
Old
grace1004 grace1004 is offline
Senior Member
grace1004 is on a distinguished road
 
Posts: 890
Join Date: Dec 2010
Default 03-21-2013, 08:53 AM

My local emails are not U.S. based, while your emails are all U.S. based.

For email blocking and the solution, please refer to the following link:

http://www.000webhost.com/forum/faq/...receiving.html
Reply With Quote
(#6)
Old
Yurgen Yurgen is offline
Junior Member
Yurgen is on a distinguished road
 
Posts: 9
Join Date: May 2009
Default 03-21-2013, 09:44 AM

On server27.000webhost.com mail() also doesn't work.
Please, couldn't you check?
Reply With Quote
(#7)
Old
ShocK's Avatar
ShocK ShocK is offline
Senior Member
ShocK is on a distinguished road
 
Posts: 5,474
Join Date: Jul 2011
Location: UK
Default 03-21-2013, 09:50 AM

Have you used the URL above to check?
Reply With Quote
(#8)
Old
Yurgen Yurgen is offline
Junior Member
Yurgen is on a distinguished road
 
Posts: 9
Join Date: May 2009
Default 03-21-2013, 09:56 AM

For check I used: http://server27.000webhost.com/mailtest.php. This server doesn't work. I don't receive the test email.

For example, http://server29.000webhost.com/mailtest.php works well.

Last edited by Yurgen; 03-21-2013 at 10:00 AM.
Reply With Quote
(#9)
Old
ShocK's Avatar
ShocK ShocK is offline
Senior Member
ShocK is on a distinguished road
 
Posts: 5,474
Join Date: Jul 2011
Location: UK
Default 03-21-2013, 10:01 AM

Same here, server29 I recieved confirmation but nothing for 27, so for me it doesn't work using a gmail account or my own ISP's email.
It's most likely being blocked by our ISP's or has been blacklisted for spam, either way there's not much that can be done about it.
Reply With Quote
(#10)
Old
merlieon merlieon is offline
Junior Member
merlieon is on a distinguished road
 
Posts: 10
Join Date: Mar 2013
Default 03-21-2013, 12:47 PM

so arent there able to change server 27 to server 29?? or how was it about that SMTP thingy??

if it work with SMTP i have no idea how to do that XD
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com