MyBB Community Forums

Full Version: Mail System Issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been trying to get my automated mail system on my board working, to no avail. I followed the instructions in the help wiki to see if the php mail system was working. After I made and uploaded the file to my /forum directory and checked it in my browser, I got a blank white screen with the following test across the top: <?php error_reporting(E_ALL); $to = '[email protected]'; if(mail($to, 'Testing mail', 'This is a mailing test to see if PHP mail works.')) { echo 'Mail was sent by PHP'; } else { echo 'PHP could not send the mail'; } ?>

I recognize this as the test code, but I also not that I don't see the mail sent message. So... where do I go from here?
It shouldn't be outputting the code like that. Did you save it as a .php extension...??
(2010-03-24, 12:17 PM)MattRogowski Wrote: [ -> ]It shouldn't be outputting the code like that. Did you save it as a .php extension...??

That I did. Attached is the file that I used.
It won't work with <pre>&lt;?php at the start and ?&gt;</pre> at the end. Put this in:

<?php
error_reporting(E_ALL);

$to = '[email protected]';

if(mail($to, 'Testing mail', 'This is a mailing test to see if PHP mail works.'))
{
     echo 'Mail was sent by PHP';
}
else
{
     echo 'PHP could not send the mail';
}
?>
(2010-03-24, 05:55 PM)MattRogowski Wrote: [ -> ]It won't work with <pre>&lt;?php at the start and ?&gt;</pre> at the end. Put this in:

<?php
error_reporting(E_ALL);

$to = '[email protected]';

if(mail($to, 'Testing mail', 'This is a mailing test to see if PHP mail works.'))
{
     echo 'Mail was sent by PHP';
}
else
{
     echo 'PHP could not send the mail';
}
?>


I figured out why is was spitting out test code. When I entered the code, I put it under the design tab, and not the code tab. Once I figured that one out, I entered the code you provided, ran the file in my browser and it spat out this:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/j/a/r/jarrodbagwell/html/forum/forumtest.php on line 7
Not sure how you're copying and pasting to get these errors. Make sure you keep the ' ' around the email address intact when you put yours in. Upload this:
[attachment=17712]
(2010-03-25, 12:26 PM)MattRogowski Wrote: [ -> ]Not sure how you're copying and pasting to get these errors. Make sure you keep the ' ' around the email address intact when you put yours in. Upload this:

I put in the file you provided, and I received the "Mail sent by PHP" message. This means a message should have been sent to the forum board email address I specified under general settings yes?

I really appreciate all of your help btw.
You've to edit your email address in that file, run the file and check if you received the email Smile
(2010-03-25, 02:14 PM)Discoman Wrote: [ -> ]
(2010-03-25, 12:26 PM)MattRogowski Wrote: [ -> ]Not sure how you're copying and pasting to get these errors. Make sure you keep the ' ' around the email address intact when you put yours in. Upload this:

I put in the file you provided, and I received the "Mail sent by PHP" message. This means a message should have been sent to the forum board email address I specified under general settings yes?

No... it sends an email to the address in this file.

$to = '[email protected]';

The whole point of this test is to test PHP mail with no interaction with MyBB at all, just purely testing the mail function.
Well, after waiting a bit I did receive the test mails in the email account that I specified. They came in the spam folder. This means that php is working so the next thing i'll do is check with my web host and see if they are gumming anything up. Alternatively, if someone would like to sign up who has a gmail account you can see if you get the activation email in your spam folder.
Pages: 1 2