arun kamboj
arun kamboj

Reputation: 1315

Anchor links not display properly in email

I am using Drupal 7 for my project. I am sending email to admin and user on webform submission.

If i send any html email without anchor link then its formatted properly in email but if i add any anchor link into my email then it is not display properly in email.

I have tried to add the anchor into plain text as well as html table format but every time it destroyed the email format.

I have tried to send email using rules and also using webform but every time i got same result.

I am using smtp module for sending the email using sendgrid mail system.

I have configured the smtp setting for send grid using the following link

https://sendgrid.com/docs/for-developers/sending-email/drupal/#using-the-smtp-authentication-support-module

Here is my email format

<p> Dear  Test,</p>
<a href="https://stackoverflow.com">Test link </a>

Here is the email i received every time after adding anchor.

    Dear Test, 
    Test link [1] 
    [1] https://stackoverflow.com

Any Idea?

Upvotes: 1

Views: 321

Answers (1)

S.T.A.L.K.E.R.
S.T.A.L.K.E.R.

Reputation: 26

Drupal converts all html emails as plain text. You need to tell Drupal to send your email as HTML. See this link for clarification: https://www.drupal.org/node/224333#email-html.

(issue) By default, Drupal core and drupal_mail() assume that any mail that is sent through Drupal is HTML. Therefore, all e-mail messages are converted into plain-text as the last step of Drupal's default e-mail processing

Also: See this question: https://drupal.stackexchange.com/questions/27063/how-to-send-html-email Your question is probably already answered there.

Upvotes: 1

Related Questions