Hi all, my name is George. I want to send email from html site. Is there a way to send the email from the form inside the website directly without the site opening Outlook or something like that?

Recommended Answers

All 7 Replies

You can do it with PHP. IF you embed php in your html files it is quite easy. Google email with php and you should find a pretty comprehensible tutorial.

As mentioned above embedding php code in your pages will work and it won't open ms outlook. check the mail() command in php.Lots of stuff on the internet on email senders.

or you must send your form to asp. if u want to use asp, post rply

If you don't want to use any javascript or complex coding, a helpful tool that I have used int he past is a program on the net such as http://www.jotform.com and/or http://www.wufoo.com .

Basically these sites let you customize forms create the javascript and basically you have to place the html they created into your html.

The full service costs money, but there is a free limited service. For the free service, it only allows 100 emails per month, which is sufficient for smaller sites.

most server language have a mail function
php
asp
perl
without coding your own you could google
cgi mail script,,php mail script,,asp mail script,,
Big nose bird http://bignosebird.com/cgi.shtml has a cgi script, auto reply, address verification, required fields, redirect on success, etc etc all bells and whistles very configurable from within the html forms, easy to setup while you learn to code your own

sorry to jump on this but im having the same problem

this is my html

<FORM encType=text/plain action=mailto:recipient@mydomain.co.uk>
      <TABLE border=0 cellSpacing=0 cellPadding=4 width="90%">
        <TBODY>
        <TR>
          <TD width="30%">
            <DIV align=right><B><FONT color=#ffffff 
            face=Candara>Name:</FONT></B> </DIV></TD>
          <TD width="70%"><INPUT name=name> </TD></TR>
        <TR>
          <TD>
            <DIV align=right><B><FONT color=#ffffff 
            face=Candara>Email:</FONT></B></DIV></TD>
          <TD><INPUT name=email> </TD></TR>
        <TR>
          <TD>
            <DIV align=right><B><FONT color=#ffffff 
            face=Candara>Message:</FONT></B> </DIV></TD>
          <TD><TEXTAREA wrap=virtual rows=4 cols=30 name=comment></TEXTAREA> 
          </TD></TR>
        <TR>
          <TD>&nbsp;</TD>
          <TD><INPUT value=Submit type=submit name=submit> 
      </TD></TR></TBODY></TABLE></FORM>

With the correct email address in, it is opening up outlook.

Where would I need to insert the php to make this just send without opening outlook please?

my provider is 1 and 1 and ive read their help section that perl php etc are all supported


thanks very much!!!

<FORM encType='text/plain' action='mailto:recipient@mydomain.co.uk'>

quotes, validate the html

<FORM method='post' action='full-url-to-form-handler-script-including-SELF-if-mail-handler-is-declared-within-the-same-file'>

generic mailer use

<?php ob_start("ob_gzhandler"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<htm>
<head>
<title>Tell A friend -</title>
<P>Tell a friend about our site!</p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method='post'>
<input type='hidden' value="add this message to everything the user sends" name='essage1'>
<div style='width:100%; float:left;'>
<div style='width:39%; text-align: right; float:left;'>To (Friend's name) : </div>
<div style='width:59%; text-align: left; float:right;'><input class='infor' type='text' size='40' value='<?php echo $to_name; ?>' name='to_name'>
</div>
<div style='width:100%; float:left;'>
<div style='width:39%; text-align: right; float:left;'>To (Friend's email) :  </div>
 <div style='width:59%; text-align: left; float:right;'><input  type='text' size='40' value='<?php echo $to_email; ?>' name='to_email'>
 </div>
</div>
<div style='width:100%; float:left;'>
<div class='required' style='width:39%; text-align: right; float:left;'>From (Your name) :
 </div>
 <div class='required' style='width:59%; text-align: left; float:right;'><input class='infor' type='text' size='40' value='<?php echo $from_name; ?>' name='from_name'>
</div>
</div>
<div style='width:100%; float:left;'>
<div style='width:39%; text-align: right; float:left;'>From (Your email) :   </div>
 <div style='width:59%; text-align: left; float:right;'><input class='infor' type='text' size='40' value='<?php echo $from_email; ?>' name='from_email'>
  </div>
 </div>
<div style='width:100%; float:left;'>
 <div style='width:39%; text-align: right; float:left;'>Message :
 </div>
<div class='required' style='width:59%; text-align: left; float:right;'><textarea name='message' cols='45' rows='6'></textarea>
  </div>
 </div>
</div>
<div class="dontprint" style='width:100%; float:left;'>
 <center>
  <button type="submit" name="subm" value="submit" onclick="return(confirm('Are all fields complete?'));" >Submit</button>
<button name="reset" type="reset" VALUE="Reset" >Reset</button>
</div>
</form>
<?php If ($to_email && $message1 && $subject) {
$to = "\"$to_name\" <$to_email>";
$from = "\"$from_name\" <$from_email>";
$to = str_replace("\\'", "'", $to);
$from = str_replace("\\'", "'", $from);
$subject = str_replace("\\'", "'", $subject);
$message = str_replace("\\'", "'", $message);
mail($to, $subject, "Hi $to_name $message1 $message", "From: $from " . "\r\n" . "Cc: $from " . "\r\n" . "Bcc: mailcheck@dockreyapartments.com");
echo "<div style='width:100%; float:left;'>Mail message sent  To : $to <BR> From : $from";
echo "\r\n Subject : $subject \r\n Message:'Hi' $to_name \r\n $message1 \r\n $message </div>";
 }
Else {
echo '<div style="width:100%; float:left;"><font size="-1">This program does not check for correct address ';
echo 'formats, <BR>If the email addresses are not correct the receiving mail server ';
echo 'will not respond and mail will not be sent,<br> neither will it be saved.<br> ';
echo 'Please ensure the mail details are correct or your friend will not receive ';
echo 'the link.</font></div>';
} ?><p>&nbsp;</p></body></html>
<?php ob_flush(); ?>

this too is crappy code, but i wrote it in between cutting the grass

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.