Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Closed Thread
Thread Tools Display Modes
Share |
Old 12-19-2017, 11:37 PM
pritdesign pritdesign is offline
Junior Member
Join Date: 12-19-17
Posts: 1
iTrader: 0 / 0%
Contact form with SMTP authentication

How to create the contact from PHP file with SMTP authentication?



Old 12-26-2017, 02:51 AM
dandowney dandowney is offline
Join Date: 12-07-17
Posts: 28
iTrader: 0 / 0%
I have used the below method to send a mail.
PHP Code:
require_once "Mail.php";

$from "Sandra Sender <sender@example.com>";
$to "Ramona Recipient <recipient@example.com>";
$subject "Hi!";
$body "Hi,\n\nHow are you?";

$host "mail.example.com";
$username "smtp_username";
$password "smtp_password";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp Mail::factory('smtp',
  array (
'host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail $smtp->send($to$headers$body);

if (
PEAR::isError($mail)) {
"<p>" $mail->getMessage() . "</p>");
 } else {
"<p>Message successfully sent!</p>");
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help coding a simple form itsBeau Coding Forum 3 02-16-2018 09:32 PM
[WTS] Magento 2 Form Builder Extension gerbertsteinmann Content 1 02-09-2018 04:15 AM
How to Create an Efficient Contact Page That Boosts Your Productivity HTMLBasicTutor Online Business Forum 2 11-10-2017 06:53 AM
[WTS] Magento 2 custom form builder by Itoris gerbertsteinmann Content 0 10-26-2017 07:06 AM
how to find what is taking so long on a form submission? php/mysql imadam Coding Forum 4 05-09-2017 06:46 AM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 06:43 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC