Bizzare problem... can't send Email outside of my own domain
Posted: Wed Dec 05, 2007 12:56 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi all,
I am having a really bizzare problem with Swift mailer. I have been using it for about 6 month now without any issue. Recently, I switched web host (Media Temple), and it worked for a day then it stopped working! It gets better, after hours of trying to debug the issue, using the most basic SwiftMailer functions to test the issue, I learned that for some reason I cannot send mail outside of my domain. SO, if the receipient is something@mydomain.com, it works fine. But if it's anything other than mydomain.com, it fails. Could someone please enlighten me what's the problem I am running into?
Also... php's mail() function works fine as well. My mail server doesn't require SMTP authentication (as far as I can tell, since mail() works fine).
I am using the most basic swiftmailer functions, removed the actual domain name, included below:Code: Select all
<?php
//Load Swift Mailer
require_once($_SERVER['DOCUMENT_ROOT']."/swift/lib/Swift.php");
require_once($_SERVER['DOCUMENT_ROOT']."/swift/lib/Swift/Connection/SMTP.php");
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("mail.mydomain.com"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "test@yahoo.com", "me@mydomain.com")) echo "Sent";
else echo "Failed";
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]