Jump to content

Trouble-Shoot - Doesn't seem right


ChompGator

Recommended Posts

My webhost recently changed their SMTP information, this is what they say:

""Could you please modify your code to be like our code and to use "mail.yourdomain.com" as outbound SMTP server with "SMTP authentication" via "PHPmailer"? A sample code is below (which I have included in this post""

 

So right now Im using phpmailer (I have a whole form that sends out an email but this is the part I think they mean to change) - I dont know if this seems right - so I wanted to ask before I start messing stuff up... And this is my code:

 

"From: [email protected]\r\n".
"Reply-To: [email protected]\r\n".
"X-Mailer: PHP/".phpversion());

 

Based on their sample code (which is below) this is what they want me to change that little bit above to:

 

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();$mail = new PHPMailer();
$mail->CharSet ="utf-8"; // You can adjust the Charset according to your language
$mail->IsSMTP();
$mail->Host = "mail.mydomain.com";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "[email protected]";

$mail->AddAddress("sendTOemail"); // Do I leave whats between the "" quotations like this or do I change it to $email (so the script knows to retrieve the email address)??
$mail->Subject = "Test 1";
$mail->Body = "Test 1 of PHPMailer.";

if(!$mail->Send())
{
   echo "Error sending: " . $mail->ErrorInfo;;
}
else
{
   echo "Letter is sent";
}?> 

 

 

Does that seem right to all you fellow programmers out there? If so Ill proceed with this, but I dont want to add this in and start screwing up a script that took me two days to make

 

Link to comment
https://forums.phpfreaks.com/topic/119835-trouble-shoot-doesnt-seem-right/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.