Support » Plugin: WP Mail SMTP by WPForms » Office365 Relay

  • I recently had to edit sendmail to use office365 as my mail relay. Due to the requirements of Office365 I had to set the return path and replyto parameters in the phpmailer class.

    The following lines of code need to be added after lines #95 and #126 in the wp_mail_smtp.php file.

    $phpmailer->ReturnPath = $phpmailer->FromName;
    $phpmailer->AddReplyTo($phpmailer->FromName, $phpmailer->FromName);

    It would have been nice to have an extra field in the options to set the replyto address manually. Perhaps an update?

    https://wordpress.org/plugins/wp-mail-smtp/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I get a white Screen after a form tries to use the mail function after adding those 2 lines of code. Is that all you did is add the 2 lines after line 95 and add them after 126?

    Thanks for any help!

    Yeah, that was pretty much all I had to do.

    When I added the 2 lines after both locations it broke the plugin, any ideas?

    In your config.php enable wp_debug (define(‘WP_DEBUG’, true);) and see if you get something more than a white screen. Besides that, remove the lines of code you added and confirm that the plugin is back to normal.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Office365 Relay’ is closed to new replies.