Jump to content

PHP mail()


Pain

Recommended Posts

Hi.

 

If the mail() function is disabled by the server is there still any other way to send emails with PHP?

 

I've tried something like this, but it didn't work.

 

<?php

$email_from = "[email protected]";

ini_set("sendmail_from", $email_from);

$to = "[email protected]";
$subject = "subject";
$message = "message";
$headers = "From: $email_from";

mail($to, $subject, $message, $headers);

?>

Link to comment
https://forums.phpfreaks.com/topic/255997-php-mail/
Share on other sites

Just because it didn't work doesn't mean the function is disabled. Did you get an error message telling you mail() was disabled or something?

 

you bring up a good point, I assumed by the context of the post that the OP had confirmation that the mail() function has been disabled. OP, if you are not sure if the mail() function is disabled, this conversation will take a different route.

Link to comment
https://forums.phpfreaks.com/topic/255997-php-mail/#findComment-1312439
Share on other sites

As I have said on another post today, some hosting companies insist that you make the 'from:' value an email address from your domain. Like [email protected] if you are trying to send mail from yourdomain.com . mail only gives a true/false I think which is not much help sometimes.

Link to comment
https://forums.phpfreaks.com/topic/255997-php-mail/#findComment-1312533
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.