Pain Posted January 29, 2012 Share Posted January 29, 2012 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 More sharing options...
AyKay47 Posted January 30, 2012 Share Posted January 30, 2012 you could try using a third party mailer like PHPmailer() to bypass this, or switch hosts. Link to comment https://forums.phpfreaks.com/topic/255997-php-mail/#findComment-1312419 Share on other sites More sharing options...
Pikachu2000 Posted January 30, 2012 Share Posted January 30, 2012 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? Link to comment https://forums.phpfreaks.com/topic/255997-php-mail/#findComment-1312438 Share on other sites More sharing options...
AyKay47 Posted January 30, 2012 Share Posted January 30, 2012 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 More sharing options...
ocpaul20 Posted January 30, 2012 Share Posted January 30, 2012 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.