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: postmaster@mydomain.com\r\n".
"Reply-To: postmaster@mydomain.com\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 = "postmaster@mydomain.com";
$mail->Password = "postmaster@mydomain.com";

$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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