Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

why i get this SMTP Error: Could not authenticate. error please help! :(

ScreamAimsFire

Proficient
Advanced Member
Messages
228
Reaction score
13
Points
38
why i get this SMTP Error: Could not authenticate. error please help! :(

Yan po lumalabas pag nag sesend ako using my contact form na ginawa :( sana po may makatulong o makasagot sakin.:pray:

View attachment 268941


at my na rereceive naman po ako sa gmail ko na ganito :slap:


View attachment 268942


Code:
<?php
if(isset($_POST['submit'])) 
{

$message=
'Full Name:	'.$_POST['fullname'].'<br />
Subject:	'.$_POST['subject'].'<br />
Phone:	'.$_POST['phone'].'<br />
Email:	'.$_POST['emailid'].'<br />
Comments:	'.$_POST['comments'].'
';
    require "phpmailer/class.phpmailer.php"; //include phpmailer class
      
    // Instantiate Class  
    $mail = new PHPMailer();  
      
    // Set up SMTP  
    $mail->IsSMTP();                // Sets up a SMTP connection  
    $mail->SMTPAuth = true;         // Connection with the SMTP does require authorization    
    $mail->SMTPSecure = "ssl";      // Connect using a TLS connection  
    $mail->Host = "smtp.gmail.com";  //Gmail SMTP server address
    $mail->Port = 465;              //Gmail SMTP port
    $mail->Encoding = '7bit';
    
    // Authentication  
    $mail->Username   = "[email protected]"; // Your full Gmail address
    $mail->Password   = "mygmailpassword"; // Your Gmail password
      
    // Compose
    $mail->SetFrom($_POST['emailid'], $_POST['fullname']);
    $mail->AddReplyTo($_POST['emailid'], $_POST['fullname']);
    $mail->Subject = "New Contact Form Enquiry";      // Subject (which isn't required)  
    $mail->MsgHTML($message);
 
    // Send To  
    $mail->AddAddress("[email protected]", "Recipient Name"); // Where to send it - Recipient
    $result = $mail->Send();		// Send!  
	$message = $result ? 'Successfully Sent!' : 'Sending Failed!';      
	unset($mail);

}
?>
<html>
<head>
  <title>Contact Form</title>
</head>
<body>
					
		<div style="margin: 100px auto 0;width: 300px;">
			<h3>Contact Form</h3>
			<form name="form1" id="form1" action="" method="post">
					<fieldset>
					  <input type="text" name="fullname" placeholder="Full Name" />
					  <br />
					  <input type="text" name="subject" placeholder="Subject" />
					  <br />
					  <input type="text" name="phone" placeholder="Phone" />
					  <br />
					  <input type="text" name="emailid" placeholder="Email" />
					  <br />
					  <textarea rows="4" cols="20" name="comments" placeholder="Comments"></textarea>
					  <br />
					  <input type="submit" name="submit" value="Send" />
					</fieldset>
			</form>
			<p><?php if(!empty($message)) echo $message; ?></p>
		</div>
					
</body>
</html>

Sana po may makatulong sa problema ko nag search na po ako google youtube pero diko ma solutionan first time ko po kasi gumamit ng mailer salamat po sa makakasagot TIA :salute:
 

Attachments

  • ss2.png
    ss2.png
    11 KB · Views: 24
  • ss.png
    ss.png
    9.1 KB · Views: 21
Yan po lumalabas pag nag sesend ako using my contact form na ginawa :( sana po may makatulong o makasagot sakin.:pray:

View attachment 1122509


at my na rereceive naman po ako sa gmail ko na ganito :slap:


View attachment 1122510


Code:
<?php
if(isset($_POST['submit'])) 
{

$message=
'Full Name:	'.$_POST['fullname'].'<br />
Subject:	'.$_POST['subject'].'<br />
Phone:	'.$_POST['phone'].'<br />
Email:	'.$_POST['emailid'].'<br />
Comments:	'.$_POST['comments'].'
';
    require "phpmailer/class.phpmailer.php"; //include phpmailer class
      
    // Instantiate Class  
    $mail = new PHPMailer();  
      
    // Set up SMTP  
    $mail->IsSMTP();                // Sets up a SMTP connection  
    $mail->SMTPAuth = true;         // Connection with the SMTP does require authorization    
    $mail->SMTPSecure = "ssl";      // Connect using a TLS connection  
    $mail->Host = "smtp.gmail.com";  //Gmail SMTP server address
    $mail->Port = 465;              //Gmail SMTP port
    $mail->Encoding = '7bit';
    
    // Authentication  
    $mail->Username   = "[email protected]"; // Your full Gmail address
    $mail->Password   = "mygmailpassword"; // Your Gmail password
      
    // Compose
    $mail->SetFrom($_POST['emailid'], $_POST['fullname']);
    $mail->AddReplyTo($_POST['emailid'], $_POST['fullname']);
    $mail->Subject = "New Contact Form Enquiry";      // Subject (which isn't required)  
    $mail->MsgHTML($message);
 
    // Send To  
    $mail->AddAddress("[email protected]", "Recipient Name"); // Where to send it - Recipient
    $result = $mail->Send();		// Send!  
	$message = $result ? 'Successfully Sent!' : 'Sending Failed!';      
	unset($mail);

}
?>
<html>
<head>
  <title>Contact Form</title>
</head>
<body>
					
		<div style="margin: 100px auto 0;width: 300px;">
			<h3>Contact Form</h3>
			<form name="form1" id="form1" action="" method="post">
					<fieldset>
					  <input type="text" name="fullname" placeholder="Full Name" />
					  <br />
					  <input type="text" name="subject" placeholder="Subject" />
					  <br />
					  <input type="text" name="phone" placeholder="Phone" />
					  <br />
					  <input type="text" name="emailid" placeholder="Email" />
					  <br />
					  <textarea rows="4" cols="20" name="comments" placeholder="Comments"></textarea>
					  <br />
					  <input type="submit" name="submit" value="Send" />
					</fieldset>
			</form>
			<p><?php if(!empty($message)) echo $message; ?></p>
		</div>
					
</body>
</html>

Sana po may makatulong sa problema ko nag search na po ako google youtube pero diko ma solutionan first time ko po kasi gumamit ng mailer salamat po sa makakasagot TIA :salute:

Check this out:
https://github.com/PHPMailer/PHPMailer
 
Di ko pa tinitingnan yung code mo pero based dun sa reply sa email mo, hindi nakaallow sa gmail account mo yung mga "less secured apps". By default kasi nakaoff yun.
Punta ka sa My Account > Sign in and security > Connected apps and sites Then i-on mo yung Allow less secured apps.
 
Hahaha.. meron kapang isang thread? Nagreply ako sa nauna mong post. hahaha. Try mo nalang din, baka OK. Working sakin to.
 

Attachments

  • sample Sending Email.rar
    18.4 KB · Views: 8
Salamat po mga sir try ko po

- - - Updated - - -

Hahaha.. meron kapang isang thread? Nagreply ako sa nauna mong post. hahaha. Try mo nalang din, baka OK. Working sakin to.

Madami kasing kulang sa code mo.. Walang "name" ang mga inputs mo.. Then sa form walang "method"..

Try mo yung naka attach.. gmail ang nakaset sa Host. Palitan mo nalang ng yahoo. Pero kung ayaw sa yahoo, itry mo sa gmail. Working sakin yan.

Sana makatulong... ;)

Warning: require_once(class.smtp.php): failed to open stream: No such file or directory in C:\xampp\htdocs\sampleSendingEmail\class\class.phpmailer.php on line 702

Fatal error: require_once(): Failed opening required 'class.smtp.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\sampleSendingEmail\class\class.phpmailer.php on line 702


sir my error po :(
View attachment 1122665

View attachment 1122666
 
Back
Top Bottom