email is using local smtp server instead of remote smtp

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

email is using local smtp server instead of remote smtp

Post by s.dot »

This is how I've configured Swift

Code: Select all

//load the SMTP connection and authenticate
$smtp = new Swift_Connection_SMTP('smtp.1and1.com', 25);
$smtp->setUsername('me@mydomain.com');
$smtp->setpassword('password');

//start up swift with our SMTP connection
$swift = new Swift($smtp);

//build an HTML message
$message = new Swift_Message($subject);
$message->attach(new Swift_Message_Part($emailText));
$message->attach(new Swift_Message_Part($email, 'text/html'));

//send, yo!
$swift->send($message, $emailAddress, $from);
However, when I get a bounceback, the email tells me it was sent from my local host

Code: Select all

--- The header of the original message is following. ---

Received: from [server.ip.add.ress] (host.mydomain.com [server.ip.add.ress])
	by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis)
	id 0MKpCa-1J6JNI1Tot-0001Yt; Sun, 23 Dec 2007 00:27:45 -0500
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply