| | |
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 |
ajax apache api array arrays beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external file files folder form forms forum function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu method mlm multiple mysql neutrality oop paypal pdf php phpmysql play problem query question radio random recursion regex remote root script search select server sessions sms soap source space sql syntax system table tutorial update upload url validator variable video web xml youtube





