Jump to content

pomoore

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by pomoore

  1. Hi, I dont get any error, the page goes to an "error page not found" page and the form does not send to the specified email.
  2. Hi, Many thanks for getting back to me, but unfortunately i Had no joy with this! I downloaded PHP-Mailer and included phpmailer.inc.php and smtp.inc.php into a phpmailer folder in my main website folder. Below is the form code im using: <div id="brochure"> Request a Company Brochure. <form action="mailer2.php" method="post"> <fieldset> <input type="text" name="name" value="Name…" onfocus="this.value=(this.value=='Name…')? '' : this.value ;" /> <input type="text" name="email" value="Email…" onfocus="this.value=(this.value=='Email…')? '' : this.value ;" /> <input type="submit" name="submit" class="button" id="submit_btn" value="Submit →"/> </fieldset> </form> and below is the new mailer php script i created using your advice: <?php require_once('phpmailer/phpmailer.inc.php'); include("phpmailer/smtp.inc.php"); $emailaddress = 'pomoore@jbbarry.ie'; $message= 'Name: '.$_POST['name'].'<br /> Email: '.$_POST['email'].'<br /> Subject: '.$_POST['subject'].'<br /> IP: '.$_SERVER['REMOTE_ADDR'].'<br /><br /> Message:<br /><br /> '.nl2br($_POST['msg']).' '; $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.gmail.com"; // SMTP server //$mail->SMTPDebug = 2; // 1 = errors and messages,2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp@gmail.com"; // sets the SMTP server $mail->Port = 25; // set the SMTP port for the GMAIL server $mail->Username = "test@gmail.com"; // SMTP account username (the email account your created) $mail->Password = "password"; // SMTP account password (the password for the above email account) $mail->CharSet = 'UTF-8'; // so it interprets foreign characters $mail->SetFrom($_POST['email']); $mail->AddReplyTo($_POST['email']); $mail->Subject = "Contact form from ".$_POST['name']." "; $mail->MsgHTML($message); $mail->AddAddress($emailaddress); $mail->Send(); ?> Apologies if this seems stupid, as im sure ive missed something easy! but im a graphic designer and learnt an easy php script that has never needed this level of thought before!! Thanks again...
  3. Hi All, I am in dire need of help!! I am trying to use this contact form http://www.jbbarry.ie/jbb/contact.html (which works perfectly on a testing server) but will not work on the company domain. It uses a PHP mailer, which apparently my web host has disabled due to spam? So I need to make my PHP mailer work with SMTP. Below is the form code: <div id="brochure"> Request a Company Brochure. <form action="mailer.php" method="post"> <fieldset> <input type="text" name="name" value="Name…" onfocus="this.value=(this.value=='Name…')? '' : this.value ;" /> <input type="text" name="email" value="Email…" onfocus="this.value=(this.value=='Email…')? '' : this.value ;" /> <input type="submit" name="submit" class="button" id="submit_btn" value="Submit →"/> </fieldset> </form> And below is the PHP script mailer.php, can anyone help me out and explain how to change it into smtp authentication? <?php if(isset($_POST['submit'])) { $to = "peteomoore@gmail.com"; $subject = "Brochure Request"; $name_field = $_POST['name']; $email_field = $_POST['email']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; mail($to, $subject, $body); header('Location: brochure-request.html'); } else{ echo "test!"; } ?> Thanks in advance for any help you can give me....
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.