Saturday, April 17, 2010

Code for sending email using php?

Could someone write the html/php code for me? I want someone to enter their name, email address, subject, and body of the message. On send, I want the email sent to me@mine.com, I'll change it later, with their name attached to the email, and an email sent to their email address from do-not-reply@mine.com with the same subject and my reply message.





I know I'm asking for a lot but I'm thinking that someone may already have it written for the same reason.

Code for sending email using php?
Basically code a form to populate the variables below





//Create email fields into variables to,subject,from etc etc


$to = "somebody@somewhere.com";


$subject = "your subject";


$from = "From: you@yourdomain.com\r\n";


$message="some message text";





//create and send the mail


mail($to, $subject, $message, $from);
Reply:What you are describing is a good recipe for getting your whole domain name tagged as a spammer, and having all the emails you send ending up in your recipient's "Bulk Mail" folder (if at all). UNLESS you're only allowing registered users to send mail, OR you've got a LOT of testing algorithms in place to prevent the hacking of the form.
Reply:Yes, check this out,





http://formtoemail.com/





Are you on a free webhost? You might be out of luck.





In order for it to run, you must have PHP (version 4.1.0 or later) on your webhosting account, and have the PHP mail() function enabled and working.


No comments:

Post a Comment