ChompGator Posted August 15, 2008 Share Posted August 15, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.