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@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);

?>

Link to comment
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
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 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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.