DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   emailto option in php (http://www.daniweb.com/forums/thread201167.html)

DiyaMV Jul 2nd, 2009 6:38 am
emailto option in php
 
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.

kireol Jul 2nd, 2009 8:19 pm
Re: emailto option in php
 
nothing in PHP to do this. If anything it'd be a MIME type in HTML

FlashCreations Jul 2nd, 2009 11:02 pm
Re: emailto option in php
 
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.

emarshah Jul 3rd, 2009 3:41 am
Re: emailto option in php
 
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>"

FlashCreations Jul 3rd, 2009 10:25 pm
Re: emailto option in php
 
Quote:

Originally Posted by emarshah (Post 907186)
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:
.


All times are GMT -4. The time now is 7:19 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC