| | |
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 |
# 5.2.10 access action address alexa apache api array auto autoincrement broken cakephp checkbox class classes clean clients cms code cron curl database date dehasher destroy directory dissertation domain dynamic echo$_get[x]changingitintovariable... email encode error errorlog fairness fatalerror file folder form function functions google href htaccess html image include indentedsubcategory ip javascript joomla legislation limit link load local login masterthesis memberships menu multiple multipletables mysql mysqlquery newsletters oop open passwords paypal pdf persist php popup provider query radio random script search secure server sessions simple sockets source space spam sql system table tutorial upload url user variable video voteup web youtube





