0

Is there emaito option in HTML available in php

I want to open up outlook so that the user reviews the filled mail before sending it.

I want to include table and chart also in the body of the message.

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by FlashCreations
0

Well this wouldn't be PHP, it would be HTML and maybe JavaScript. You could create a link on your page like this:

<?php
echo "<a href='mailto:email@domain.com?subject=Email Subject&body=Insert HTML table here and chart here' id='emailLink'>Send Email (Opens in Outlook)</a>";
?>

For more on mailto: syntax see this page.
And you could even go the extra mile by adding this JavaScript code so that the link is automatically clicked when the page loads:

<script type="text/javascript">
clickEmailLink(){document.location.href=document.getElementById('emailLink').href;}
</script>

This would require you to add onload="clickEmailLink();" as an attribute to your body tag. Like this, in case you were wondering:

<html>
<head>
...
</head>
<body onload="clickEmailLink();">
...
</body>
</html>

You must understand that not everyone in the word has Outlook or uses it. Unless you're positive that all of your users use Outlook, I would try for a simple PHP mail() command that would first print the message for the user to approve. Then once it was approved, the message would be sent by another PHP script.

0

Hello,

as the "Flash Creations " said, emailto is only to be used through html.... you can jst print it in php

like

print"<a href="emailto:abc@def.com" > Send mail</a>"

0

Hello,

as the "Flash Creations " said, emailto is only to be used through html.... you can jst print it in php

like

print"<a href="emailto:abc@def.com" > Send mail</a>"

Yes, but as far as I know, it's mailto: not emailto: .

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.