943,918 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 551
  • PHP RSS
Jul 2nd, 2009
0

emailto option in php

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DiyaMV is offline Offline
1 posts
since Jul 2009
Jul 2nd, 2009
0

Re: emailto option in php

nothing in PHP to do this. If anything it'd be a MIME type in HTML
Reputation Points: 34
Solved Threads: 51
Posting Whiz
kireol is offline Offline
305 posts
since Mar 2008
Jul 2nd, 2009
0

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 Syntax (Toggle Plain Text)
  1. <?php
  2. 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>";
  3. ?>
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:
HTML Syntax (Toggle Plain Text)
  1. <script type="text/javascript">
  2. clickEmailLink(){document.location.href=document.getElementById('emailLink').href;}
  3. </script>
This would require you to add onload="clickEmailLink();" as an attribute to your body tag. Like this, in case you were wondering:
HTML Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. ...
  4. </head>
  5. <body onload="clickEmailLink();">
  6. ...
  7. </body>
  8. </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.
Last edited by FlashCreations; Jul 2nd, 2009 at 11:06 pm.
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008
Jul 3rd, 2009
0

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>"
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
emarshah is offline Offline
61 posts
since Jan 2008
Jul 3rd, 2009
0

Re: emailto option in php

Click to Expand / Collapse  Quote originally posted by emarshah ...
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: .
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Field List Input Problem
Next Thread in PHP Forum Timeline: AXJ needs help setting up forums.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC