I have an hyperlink which has a mailto
link and I am specifying the subject and body text in the hyperlink itself. So when the user clicks on the hyperlink, his default email client application will be opened with the To, Subject and body text pre-populated in it.
I want to know how I can apply css formatting technique in the body
text of it something like font
names, font color
etc.
Can anyone give me any idea on this?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Unauthorized access</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- bootstrap 3.0.2 -->
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<!-- font Awesome -->
<link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- Theme style -->
</head>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<div>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side" style="margin-left:0">
<section class="content">
<div class="error-page" style="margin: 0">
<div class="error-content" style="width:100%">
<h3><i class="fa fa-warning text-yellow"></i> You are not authorized to view the content.</h3> <br>
<p style="width:75%; text-align:center;margin-left:15%">
Please make sure you have the access to the server or contact support team at <a href="mailto:[email protected]?subject=Unable to access server&body=Hi,%0D%0A%0D%0AMy user account does not have access for the server.%0D%0A%0D%0ARequest you to kindly provide access to server.">[email protected]</a>.
</p>
</div><!-- /.error-content -->
</div><!-- /.error-page -->
</section><!-- /.content -->
</aside><!-- /.right-side -->
</div><!-- ./wrapper -->
</body>
</html>
On clicking the email hyperlink, the below message will be shown in the email content.
I want to apply css formatting to the content highlighted in the red box.
subject=<subject> to the mailto tag. For example, the complete tag would look similar to the example below. You can also add body text by adding &body=body to the end of the tag, as shown in the example below. You can also include &cc= or &bcc= to fill out the CC and BCC fields.
It is not possible to pass the HTML in email body while using mailto link. It takes only string/text value. It says, for line breaks, instead of using <br /> use %0D%0A .
To create a link to send email, use <a> tag, with href attribute. The mail to link is added inside the <a> tag. To add a subject, you need to add ? and then include the subject. All this comes inside the <a> tag.
You can't change/modify CSS of a mail client through a <a href="mail to:[email protected]"></a>
.
They have their own CSS styles and this would be a security issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With