Skip to main content
Participating Frequently
October 7, 2012
Question

emailing with php and mysql

  • October 7, 2012
  • 2 replies
  • 604 views

I want a visitor to my site to click on a mysql field to send an email with a Bcc to myself also I want the link to show "Send an email" not the email address from the field

This topic has been closed for replies.

2 replies

David_Powers
Inspiring
October 7, 2012

Please do not post the same question in more than one forum. I'm locking this thread. All follow-up should be in http://forums.adobe.com/thread/1078310.

Rob Hecker2
Legend
October 7, 2012

MySQL is not needed for this. Below I have included all the PHP code necessary for a simple email. You just create an HTML form and include the appropriate fields. So if the form posts to itself, the code goes in a block that is run after post, using "if ($_POST['submit']){ send the email }.

One thing you should do is validate the POST before processing it.

$from="FROM: $visitor_email";

$email_subject="Message from website";

$email_body = "

Name: $name\n

Phone: $phone\n

Email: $email\n

Message: $note\n

";

mail ("$email_public", "$email_subject", "$email_body", "$from");