0
    $message = sprintf(__('Dear: %s'), $user_login) . "\r\n\r\n";
    $message .= __('As per your request on ') . date_i18n('j F Y', time());"\r\n\r\n";
    $message .= __('Please visit the following link to reset your email address:') . "\r\n\r\n";
    $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
    $message .= __('In case of any queries, you can write to us at') . "\r\n\r\n";
    $email_id_reset = '<a href="support@example.com">Email</a>';
    $message .= __('Thanks and Best Regards,') . "\r\n\r\n";

I want to show the message like the below mentioned.

In case of any queries, you can write to us at e-mail.

Thanks and regards

1
  • What is working or not working? What do you mean by in wordpress? please provide context. btw: you need mailto:support@example.com as href.
    – Sisir
    Jan 13, 2014 at 8:46

2 Answers 2

2
function set_contenttype($content_type){
    return 'text/html';
}
add_filter('wp_mail_content_type','set_contenttype');
if ( $message && !wp_mail($user_email, $title, nl2br($message), $headers) )

You should set the mail content type as "text/html".

0

I have included these lines before sending email. now it is working fine

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

    if ( $message && !wp_mail($user_email, $title, nl2br($message), $headers) )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.