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

Mailto Problem. Been messing with it for days! PLEASE HELP!!

the mail() function

Moderators: macek, egami, gesf

Postby trestian » Wed Feb 08, 2006 5:18 pm

Good day tsvehla1220!

I hope this will help you even it is a late reply..

I have seen you code seem it is good the only problem is the mail function:

mail(To,Subject,Message,From)

you have problem in To and From in the mail function...

To: is for the reciepient
from: the sender

//////// Your Code/////


But if I fill out

Email: admin@pornwallstreet.com
Message: PLEASE WORK DAMNIT!

It goes!

Yes it wil work since you have specified in your mail function that the To: will be admin@pornwallstreet.com. If the users inputed email that will not equal to admin@pornwallstreet.com it will not send since your
mail(to:is not equal to admin@pornwallstreet.com,Subject,Message,From) coz you have specified in your mail function that the To: is admin@pornwallstreet.com

<? ///your code
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "admin@pornwallstreet.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.pornwallstreet.com/" );
?>
/////////////////////

///SUGGESTED CODE

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "$email", "Feedback Form Results",
$message, "admin@pornwallstreet.com " );
header( "Location: http://www.pornwallstreet.com/" );
?>
//////

correct me if im wrong...God Bless
trestian
New php-forum User
New php-forum User
 
Posts: 51
Joined: Wed Jan 25, 2006 6:24 pm
Location: Philippines,Davao City

Postby bezmond » Sat Feb 11, 2006 2:10 am

Or, do you mean it as a feedback style form, i.e. they fill out the form to send to you? If that's the case, then unfortunately it won't work quite how you are trying to do it...

You would need to send the e-mail from an e-mail address that uses the same domain as you are on (for example whoever@whatever.com is a different domain), and so would not work as the from address, you would need to put their address as part of your e-mail:

Code: Select all
$message = $email."<br>".$message;
or something like that...

Andy[/code]
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


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.