Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

PHP email code function

the mail() function

Moderators: macek, egami, gesf

PHP email code function

Postby shizamalik » Fri Jan 13, 2012 4:38 am

Help Required :(

me trying to understand this code function from last few days but still ifffffffffffffffffffffff. plz help me;

1: we use php code to send emails how the email send without smtp authentication.

2: second one is if my hosting plan allow me to send 50 emails per day and user email me through contact us page more than 50 emails than what happened ( suspended a/c kay elawa :p )

contact us page made by this code

can user can send me unlimited emails plz plz waiting for the positive response


<?php

$site_name = "abc";
$admin_email = "info@domainname.com";
$url = "www.domainname.com";

?>



<?php

if(!$_POST['submit']){

echo "<table align=center border=0 cellspacing=0><tr><td>";
echo "
<h2>Contact Form</h2><br>
Your comments are welcome.<br /><br>
Please fill out this form and we will try to respond to you in as timely manner as possible.
<br /><br /><br />
<table class=table align=center cellspacing=0 cellpadding=5 border=0>
<form action=contactus.php method=post>
<tr><td bgcolor=#647A4E width=33%><b>Your Name:</b></td><td bgcolor=#647A4E><input type=text name=name></td></tr>
<tr><td bgcolor=#647A4E><b>Email Address:</b></td><td bgcolor=#647A4E><input type=text name=email></td></tr>
<tr><td bgcolor=#647A4E><b>Subject:</b></td><td bgcolor=#647A4E><input type=text name=subject size=30";

if(isset($_GET['subject'])){
$subject = $_GET['subject'];
echo "value=\"$subject\"";
}
echo "></td></tr>
<tr><td colspan=2 bgcolor=#647A4E>&nbsp;&nbsp;&nbsp;<b>Message:</b><br /><center><textarea name=body rows=10 cols=55>";
if(isset($_GET['body'])){
$body = $_GET['body'];
echo "$body";
}
echo "</textarea></center></td></tr>
<tr><td colspan=2 bgcolor=#647A4E><center><input type=submit class=submit name=submit value=\"Send Message\"></center></td></tr>
</form>
</table>";

}
else{

if(!$_POST['subject'] || !$_POST['body']){
echo "<span class=warning>You must fill out the Subject and the Message before this form is submitted.</span>";
}
else{

$name = $_POST['name'];
$email = $_POST["email"];
$subject = $_POST['subject'];
$body = $_POST['body'];

$subj = "Contact from $name @ $site_name: $subject";
$message = "$body\n\nSent by $name: $email";
$email_info = "From: $email";

mail($admin_email, stripslashes($subj), stripslashes($message), stripslashes($email_info));

echo "<center>Thank you, Your message has been sent.</center>";
}
}
echo "</td></tr></table>";

?>
shizamalik
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Jan 13, 2012 4:35 am

Re: PHP email code function

Postby TheProdigyGuy » Thu Jan 19, 2012 1:55 pm

1: we use php code to send emails how the email send without smtp authentication.

2: second one is if my hosting plan allow me to send 50 emails per day and user email me through contact us page more than 50 emails than what happened ( suspended a/c kay elawa :p )


1) BTW,your scripts doesn't use SMTP AUTH.
2) IMHO,no way to bypass that SERVER SIDE limitation.

Why not change your hosting company?
TheProdigyGuy
New php-forum User
New php-forum User
 
Posts: 215
Joined: Wed Dec 07, 2011 5:25 pm


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron