Jump to content

tiagofrancis

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tiagofrancis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have the folloowing code working to send an e-mail. The e-mail is sent but with no body? Help? Anyone? Here is the code. <html> <head> </head><body> <form name="form1" action="button_php.php" method ="post"> <input type="Text" VALUE="username" NAME="username"> <input name="trial" type="submit" value="phpinfo" submit = "<?button_phpinfo()?>"> </form> </body></html> <?php function button_phpinfo() { require("class.phpmailer.php"); $mailer = new PHPMailer(); $mailer->IsHTML(true); $mailer->IsSMTP(); $mailer->Host = 'ssl://smtp.gmail.com:465'; $mailer->SMTPAuth = TRUE; $mailer->Username = 'evento.arquiconsult@gmail.com'; // Change this to your gmail adress $mailer->Password = 'arqui.2009'; // Change this to your gmail password $mailer->From = 'evento.arquiconsult@gmail.com'; // This HAVE TO be your gmail adress $mailer->FromName = 'Seminario HR'; // This is the from name in the email, you can put anything you like here $mailer->Body = $_POST['username']; $mailer->Subject = 'Seminario HR.'; $mailer->AddAddress('tiagofrancesco@gmail.com'); // This is where you put the email adress of the person you want to mail if(!$mailer->Send()) { echo "Message was not sent<br/ >"; echo "Mailer Error: " . $mailer->ErrorInfo; } else { echo "Message has been sent"; } } ?>
  2. Hi folks. I'm new at this. I was told to use phpmailer with html. How can i pass parameters from my textbox to my mail function? I tried a bunch of solutions but with no success. <?php function button_phpinfo() { require("class.phpmailer.php"); $username = $_POST['username']; $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Host = 'ssl://smtp.gmail.com:465'; $mailer->SMTPAuth = TRUE; $mailer->Username = 'evento@gmail.com'; // Change this to your gmail adress $mailer->Password = 'arqui.2009'; // Change this to your gmail password $mailer->From = 'evento.arquiconsult@gmail.com'; // This HAVE TO be your gmail adress $mailer->FromName = 'Seminario HR'; // This is the from name in the email, you can put anything you like here $mailer->Body = $username; $mailer->Subject = 'Seminario HR.'; $mailer->AddAddress('tiagofrancesco@gmail.com'); // This is where you put the email adress of the person you want to mail if(!$mailer->Send()) { echo "Message was not sent<br/ >"; echo "Mailer Error: " . $mailer->ErrorInfo; } else { echo "Message has been sent"; } } ?> <html> <head> </head><body> <form name="form1" action="button_php.php" method = "post"> <input ="Text" VALUE="username" NAME="username"> <input name="trial" type="button" value="phpinfo" onsubmit = "<?button_phpinfo()?>"> </form> </body></html> Thanks in advance
×
×
  • 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.