wordpress-heroku icon indicating copy to clipboard operation
wordpress-heroku copied to clipboard

can't send emails.

Open kristoffernolgren opened this issue 11 years ago • 8 comments

Heroku has disabled mail().

kristoffernolgren avatar Apr 29 '13 14:04 kristoffernolgren

Try running heroku addons:add sendgrid:starter and sending email again.

You can see the sendgrid documentation here: https://devcenter.heroku.com/articles/sendgrid

markrickert avatar Apr 29 '13 15:04 markrickert

Thanks! I did though, it's visible in dashboard.heroku.com (also before I added the plugin, I just got a server error (because of missing username/password-parameters).

kristoffernolgren avatar Apr 29 '13 15:04 kristoffernolgren

You might have to use this plugin and check the documentation on how to get your username and password. It's worth a shot!

markrickert avatar Apr 29 '13 15:04 markrickert

If I added the settings that is:

// Set to use PHP's mail()
//$phpmailer->IsMail();

// Over ride and set to use SMTP. Set enviromental variables.
$phpmailer->IsSMTP();
$phpmailer->SMTPAuth = true; // enable SMTP authentication
$phpmailer->Port = 25; // set the SMTP server port
$phpmailer->Host = 'smtp.sendgrid.net'; // SMTP server
$phpmailer->Username = $_ENV["SENDGRID_USERNAME"]; // SMTP server username
$phpmailer->Password = $_ENV["SENDGRID_PASSWORD"]; // SMTP server password
$phpmailer->From = $bloginfo = get_bloginfo( 'admin_email', 'raw' );
$phpmailer->FromName = $bloginfo = get_bloginfo( 'name', 'raw' );
$phpmailer->Sender = $bloginfo = get_bloginfo( 'admin_email', 'raw' );
//$phpmailer->AddReplyTo($bloginfo = get_bloginfo( 'admin_email', 'raw' );, $bloginfo = get_bloginfo( 'name', 'raw' ););

kristoffernolgren avatar Apr 29 '13 15:04 kristoffernolgren

Aren't those settings in the wp core? Its not usually a great idea to modify the wordpress core files. Well... i take that back... it's never a good idea to modify the core files.

markrickert avatar Apr 29 '13 16:04 markrickert

@markrickert You probably aren't interested in this anymore but you were correct. SendGrid is the way to go here and I just submitted Pull Request #65 based on your recommendation after getting it to work on my wordpress-heroku install.

Thanks,

Jim

bigtiger avatar Nov 26 '13 06:11 bigtiger

Hopefully someone can help me. Even though I added SendGrid to my app before pushing my master to Heroku, when I created the admin user account, the confirmation email wasn't sent. So when I attempt to login to WP it says my password is incorrect. If I try to reset the password I get a notice from WP saying that the host has disabled the mail() function.

All I have to go on in my web log is this:

WARNING: [pool www] child 48 said into stderr: "sh: -t: not found"

I can access my SendGrid dashboard from my Heroku app dashboard, so I'm kinda stuck! Anyone experience this before? Thanks.

ghost avatar May 04 '14 20:05 ghost

I've experienced this error before. But, I'm not sure if I'll be able to get you to a full recovery because of a bit of config that needs to be done inside of the WP admin.

If you interrogate heroku config you should see SENDGRID_PASSWORD and SENDGRID_USERNAME.

On the WP dashboard you need to configure sendgrid by adding the heroku config username and password.

sendgrid_settings__madison___wordpress

Let me know if there is anything else I can do.

bigtiger avatar May 05 '14 16:05 bigtiger