New answers tagged

1

This is not really a WordPress bug at all, it is a phpmailer one in not allowing for custom headers... if you look at class-phpmailer.php: public function getMailMIME() { $result = ''; $ismultipart = true; switch ($this->message_type) { case 'inline': $result .= $this->headerLine('Content-Type', 'multipart/related;'); ...


0

I believe the answer in your particular case does not involve the bug that is mentioned in the linked thread. There is no need to set custom headers to achieve what you state you want to do. Instead you simply set the alternative body as text using $phpmailer->AltBody. This automatically sets the to content type multipart/alternative (not ...


0

Reference link click here. Using below code you can send the mail with html format. $to = 'sendto@example.com'; $subject = 'The subject'; $body = 'The email body content'; $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail( $to, $subject, $body, $headers ); // For attachment $attachments = array( WP_CONTENT_DIR . ...


0

Is the file correctly saved? Did you try attaching a file via static path? Something like: $attachments = array(WP_CONTENT_DIR ."/uploads/myfile.pdf");


0

as stated in the link you posted: The default content type is ‘text/plain’ which does not allow using HTML. However, you can set the content type of the email by using the 'wp_mail_content_type’ filter. Adding this to functions.php, as stated in wp_mail_content_type: add_filter( 'wp_mail_content_type', 'set_content_type' ); function set_content_type( ...


0

f you're using anything that allows you to configure SMTP within WordPress, take it out. Then put everything into a function: add_action('init','delay_until_init'); function delay_until_init(){ // call wp_mail() here }


0

Finally I figured out the cause and solution to my problem above. When I trying to send email in sub domain say http://test1.example.com, without custom From email address in header, the wp_mail() function itself sets the From email as support@test1.example.com which is invalid and hence the email was not sent. So to solve this, myself added a custom From ...


0

I run into the same issue and after a research, I found out that this is a bug with class-phpmailer.php. The bug was apparently introduced in WP 4.3.2. Even if the changelog doesn't mention it, the file was modified. Only reverting wp-includes/class-phpmailer.php to the version that was included in WP 4.3.1 fixed the issue. The class itself also has a ...



Top 50 recent answers are included