HiChina hosts all seem to need to send emails through SMTP, and enable fsockopen. However, the SMTP sending method of WordPress is steam_connect_client instead of fsockopen.
HiChina hosts all seem to need to send emails through SMTP, and to enable
Recently, a friend made a blog using WordPress, but he was worried about sending emails. by default, WP cannot send emails to Unix mail servers, such as Sendmail. I have been busy for two days and basically solved this problem. while hanging out in
Ubuntu is really fun. Like command line, simple interface, different from Window. Changing the environment occasionally and learning the way of thinking in Linux is a good practice. I have also tried Ubuntu before, and want to learn some development
In order to increase WordPress's blog interactivity, some content may require visitors to sign up for login before viewing. WordPress Default Registration method is to obtain a random password in the form of mail and complete registration. However,
Change the message content type to HTML
In WordPress
Send mailYou need to use the Wp_mail () function, but the default type of message content is "Text/plain", that is, HTML is not supported.
If you want to add HTML code to the message content, you
The small editor first encountered a solution to sending an email with the prompt "cocould not connect to SMTP host". After the solution, it was found that wordpress is now in version 4.0, and the above method is not enough, certainly cannot solve
The reason must be in the WordPress PHP Mail send class. Easy Google to reason: the original Windows SMTP service does not support the name of the message format, must be written directly to address@domain.com. So the WordPress class-phpmailer.php
The SMTP sending method of wordpress uses steam_connect_client, while the HiChina host provides fsockopen, so to send the mail smoothly, you also need to modify the source file class-smtp.php of the wordpress program, change the SMTP sending method
Method One: Modify the codeStep 1: rewrite wp-includes/pluggable.php to change the default WordPress mail settings to SMTP mode.// Set to use PHP ' s mail ()//$phpmailer->ismail (); $phpmailer->issmtp ();Step 2: rewrite
This article mainly introduces the usage of PHP functions related to sending email via WordPress. It also describes how to solve common failures in sending emails. For more information, see wp_mail () the function is used to send emails, similar to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.