Jump to content

aubreymendez

New Members
  • Posts

    5
  • Joined

  • Last visited

aubreymendez's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. all the sites i design are in html....never worked on php.....
  2. the fields need to be changed here,.......but i dont know how..... <?php $smtp_host = "mail.your domain.com"; $smtp_user = "[email protected]"; $smtp_password = "xxxxxxxxxxxx"; $smtp_port = "25"; /*$smtp_ssl = "False";*/ /*$smtp_ssl = "True";*/ $mail_from = "[email protected]"; $mail_from_name = "RDS Support"; $mail_to = "[email protected]"; $mail_to_name = "RDS Support"; ?> <html> <head> <title>PHPMailer - SMTP basic test with authentication</title> </head> <body> <?php //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('Asia/Kolkata'); require_once('class.phpmailer.php'); // include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); //$body = file_get_contents('contents.html'); //$body = preg_replace('/[\]/','',$body); $body = 'Test'; echo $body; echo "---"; $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "{$smtp_host}"; // SMTP server $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "{$smtp_host}"; // sets the SMTP server $mail->Port = $smtp_port; // set the SMTP port for the GMAIL server $mail->Username = "{$smtp_user}"; // SMTP account username $mail->Password = "{$smtp_password}"; // SMTP account password $mail->SetFrom("{$mail_from}", "{$mail_from_name}"); $mail->AddReplyTo("{$mail_from}", "{$mail_from_name}"); $mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "{$mail_to}"; $mail->AddAddress($address, "{$mail_to_name}" ); //$mail->AddAttachment("images/phpmailer.gif"); // attachment //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?> </body> </html>
  3. this part is what i need to be changed.....I dont know php so pls do the needful....thanks..... <?php $smtp_host = "mail.your domain.com"; $smtp_user = "[email protected]"; $smtp_password = "xxxxxxxxxxxx"; $smtp_port = "25"; /*$smtp_ssl = "False";*/ /*$smtp_ssl = "True";*/ $mail_from = "[email protected]"; $mail_from_name = "RDS Support"; $mail_to = "[email protected]"; $mail_to_name = "RDS Support"; ?>
  4. Hi guys thanks for the reply..... the contact form code is..... <form name="htmlform" method="post" action=""> <table width="450px"> <tr> <td valign="top"> <label for="first_name">Name *</label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"/> </td> </tr> <tr> <td valign="top"> <label for="email">Email Address *</label> </td> <td valign="top"> <input type="text" name="email" maxlength="50" size="30"/> </td> </tr> <tr> <td valign="top"> <label for="telephone">Telephone Number</label> </td> <td valign="top"> <input type="text" name="telephone" maxlength="50" size="30"/> </td> </tr> <tr> <td valign="top"> <label for="comments"> Your message *</label> </td> <td valign="top"> <textarea name="comments" maxlength="1000" cols="35" rows="6"></textarea> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"/> </td> </tr> </table> </form> and the php file is....... <?php $smtp_host = "mail.your domain.com"; $smtp_user = "[email protected]"; $smtp_password = "xxxxxxxxxxxx"; $smtp_port = "25"; /*$smtp_ssl = "False";*/ /*$smtp_ssl = "True";*/ $mail_from = "[email protected]"; $mail_from_name = "RDS Support"; $mail_to = "[email protected]"; $mail_to_name = "RDS Support"; ?> <html> <head> <title>PHPMailer - SMTP basic test with authentication</title> </head> <body> <?php //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('Asia/Kolkata'); require_once('class.phpmailer.php'); // include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); //$body = file_get_contents('contents.html'); //$body = preg_replace('/[\]/','',$body); $body = 'Test'; echo $body; echo "---"; $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "{$smtp_host}"; // SMTP server $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "{$smtp_host}"; // sets the SMTP server $mail->Port = $smtp_port; // set the SMTP port for the GMAIL server $mail->Username = "{$smtp_user}"; // SMTP account username $mail->Password = "{$smtp_password}"; // SMTP account password $mail->SetFrom("{$mail_from}", "{$mail_from_name}"); $mail->AddReplyTo("{$mail_from}", "{$mail_from_name}"); $mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "{$mail_to}"; $mail->AddAddress($address, "{$mail_to_name}" ); //$mail->AddAttachment("images/phpmailer.gif"); // attachment //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?> </body> </html>
  5. The file bob.html has a 4 field contact form......Name.......email id.......phone and message. I need the rdstest.php file to be coded so that whenever the 4 fields contact form is filled up by a customer all the details should reach me at [email protected] as an email. bob.html class.phpmailer.php class.smtp.php rdstest.php
×
×
  • 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.