News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Test Mail (PHP default) not sending, errors

Started by Grammy, February 26, 2025, 11:18:37 AM

Previous topic - Next topic

Grammy

No one's getting any email, including me.  Trying to troubleshoot it this morning, and the mail type is PHP default. I don't have any of the SMTP fields filled in.  I thought I wasn't meant to, using PHP default?  The webmaster email address is connected to the domain hosting the forum (which is the only thing on that domain, root folder).  I see that the test mail is trying to send to my personal email address.  I had thought it would try to send a test mail to the webmaster email address.  Anyway, that failed with these errors:  1 general "unable to send mail" and 2 undefined:  Undefined index: message and Undefined index: subject

If you can spot the issue, I would sure appreciate some help.   :)

The block of code in Sources/ManageMail.php is:
// Send to the current user, no options.
$to = $user_info['email'];
$subject = $smcFunc['htmlspecialchars']($_POST['subject']);
$message = $smcFunc['htmlspecialchars']($_POST['message']);

$result = sendmail($to, $subject, $message, null, null, false, 0);
redirectexit($context['base_url'] . ';result=' . ($result ? 'success' : 'failure'));
}

All of my mods (not many, at that) are all hooks only, except for one which only modified ProfileModify.php and Profile.template.php.  None of the files in the backtrace have been edited.

Screenshots:

You cannot view this attachment.
You cannot view this attachment.
You cannot view this attachment.

Aleksi "Lex" Kilpinen

Most common mail issues can be resolved by actually using SMTP. The PHP default is generally a bad idea, but it's default because it usually somewhat works without you having to set it up separately.

Undefined index: message and Undefined index: subject might indicate a larger problem though, I'd guess that means you were trying to send an email with no content.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Grammy

Quote from: Aleksi "Lex" Kilpinen on February 26, 2025, 11:26:33 AMMost common mail issues can be resolved by actually using SMTP. The PHP default is generally a bad idea, but it's default because it usually somewhat works without you having to set it up separately.

Undefined index: message and Undefined index: subject might indicate a larger problem though, I'd guess that means you were trying to send an email with no content.

Oh, I hope it's as simple as changing that.  I'll do that and report back.  Thank you!

Grammy

@Aleksi "Lex" Kilpinen      All that, and all that was needed was making that switch, wow!  Thanks so much!   :)

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: