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@email.com"; ini_set("sendmail_from", $email_from); $to = "me@you.com"; $subject = "subject"; $message = "message"; $headers = "From: $email_from"; mail($to, $subject, $message, $headers); ?> Quote 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. Quote 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? Quote 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. Quote 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 webmaster@yourdomain.com if you are trying to send mail from yourdomain.com . mail only gives a true/false I think which is not much help sometimes. Quote Link to comment https://forums.phpfreaks.com/topic/255997-php-mail/#findComment-1312533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.