| | |
emailto option in php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Well this wouldn't be PHP, it would be HTML and maybe JavaScript. You could create a link on your page like this:
For more on
And you could even go the extra mile by adding this JavaScript code so that the link is automatically clicked when the page loads:
This would require you to add
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.
PHP Syntax (Toggle Plain Text)
<?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>"; ?>
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)
<script type="text/javascript"> clickEmailLink(){document.location.href=document.getElementById('emailLink').href;} </script>
onload="clickEmailLink();" as an attribute to your body tag. Like this, in case you were wondering: HTML Syntax (Toggle Plain Text)
<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.
Last edited by FlashCreations; Jul 2nd, 2009 at 11:06 pm.
•
•
Join Date: Jan 2008
Posts: 57
Reputation:
Solved Threads: 5
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>"
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>"
Syed Ammar Hassan
" A man is known by his level of Determinism "
--------------------------------------------------------
"Some cause happiness where ever they go, others whenever They go"
--------------------------XIII---------------------------
" A man is known by his level of Determinism "
--------------------------------------------------------
"Some cause happiness where ever they go, others whenever They go"
--------------------------XIII---------------------------
![]() |
Similar Threads
- php dropdown menu remembers selected option (PHP)
- format for option statment in php... (PHP)
- multidimensional array merge using PHP (PHP)
- Rateing option using php (PHP)
- PHP e-mail SMTP error ??? (PHP)
- PHP E-mail setting ??? (PHP)
- php script (PHP)
Other Threads in the PHP Forum
- Previous Thread: Field List Input Problem
- Next Thread: AXJ needs help setting up forums.
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javascript joomla keywords limit link login loop mail menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





