10 SEO Mistakes that should be avoided in WordPress
SEO optimization can help us to get high rank on search engine and build online presence. We have list of SEO Mistakes that should be avoided in WordPress
If you have mail server then you should use the wp_mail wordpress plugin. Information about Send email through wp_mail in html format with wordpress is easy. Emails are very important feature for now in the world so you need to understand better the wordpress mail functionality.
In wordpress we use the wp_mail function for sending email. Following parameters we use for wp_mail. WP developers wants to send email through wordpress.
Here is some brief and introduction about wp_mail method of wordpress. wordpress itself uses the PHPmailer for sending emails.
$to (string or array) (required) The intended recipient(s). Multiple recipients may be specified using an array or a comma-separated string. $subject (string) (required) The subject of the message. $message (string) (required) Message content. $headers (string or array) (optional) Mail headers to send with the message. (advanced) $attachments (string or array) (optional) Files to attach: a single filename, an array of filenames, or a newline-delimited string list of multiple filenames. (advanced)
<?php $attachments = array(WP_CONTENT_DIR . '/uploads/file_to_attach.zip'); $headers = 'From: My Name <firstname.lastname@example.org>' . "rn"; wp_mail('email@example.com', 'subject', 'message', $headers, $attachments); ?>
We can use this code for contact form or in functions.php file
For html format email from wordpress. we just need to add following line in functions.php file.
add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));