pop3 error?
Posted: Wed Aug 08, 2007 1:11 pm
feyd | Please use
Where do I need to focus my efforts?
Thank you for sharing your time with me.
Dan Bloch
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]
Hello!
I am excited to get the swiftmailer up as soon as possible and have run into a problem.
My knowledge of network communications and their principles is less than weak so please forgive my lack of understanding in this matter. I am just starting to test swift and am using WAMP XP-Apache2-mysql5-php5. when I run my routine I get the following error.
...A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host
has failed to respond. ....
I have an account with qwest and that gives me an account with msn as the mail provider.
I am using qwest supplied values for the hostName, port, logon and password. These are the same values in the outlook tools - email account screens.
The only difference between the outlook email account screens and Swift is that I have seen no mention of a place for the pop3 address? It probably doesnt even matter?
I did a telnet smt.xxxx.com 995 and it 'could not open connection to host on port 995....
I also did a ping and it wouldn't work.
THe code is as follows:Code: Select all
<?php
require_once ("SwiftMailer/lib/Swift.php") ;
require_once ("SwiftMailer/lib/Swift/Connection/SMTP.php");
require_once ("SwiftMailer/lib/Swift/Authenticator/$PopB4Smtp$.php") ;
// Start Swift ------------------------------------------------------
// Lang. new Swift_Connection_SMTP(string remote_host[, int remote_port [, int encryption_level]])
$smtp = new Swift_Connection_SMTP( $Institution_SMTP_host_name , $Institution_SMTP_host_Port );
//Load the PopB4Smtp authenticator with the pop3 hostname
$smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.host.tld"));
//Continue like normal
$smtp->setUsername( $Institution_SMTP_host_userName );
$smtp->setPassword( $Institution_SMTP_host_pwd );
$swift = new Swift($smtp);
// Create the instance and Subject --------SUBJECT--------------
$message = new Swift_Message("Billing for ".date("F-Y" ) );
// Attach the message part
$message->attach(new Swift_Message_Part( "Your Statement for ".date("F-Y" )." is attached to this email as a PDF file." ));
// Make the attachment with the Swift_File class
// Swift_Message_Attachment __construct
// ([mixed $data = null], [string $name = null], [string $type = "application/octet-stream"], [string $encoding = "base64"], [ $disposition = "attachment"])
// By using Swift_File you save memory by not having the file contents in memory, and by not having such a large overhead
// in encoding. This is the preferred method for attaching large files.
// Additionally, using Swift_File allows you to leave out the filename parameter
// in Swift_Message_Attachment since it provides the filename itself.
// $message->attach(new Swift_Message_Attachment( new Swift_File( "INC/Statements/".$PDF_Filename ), $PDF_Filename , "application/pdf"));
// $message->attach(new Swift_Message_Attachment( new Swift_File( "INC/Statements/".$PDF_Filename ), , "application/pdf"));
$message->attach(new Swift_Message_Attachment( new Swift_File( "INC/Statements/".$PDF_Filename )));
// Send it out
// $swift->send($message, "my-friend@host.tld", "me@my-domain.tld");
// $sent returns the number of records sent
// recipients-----> email and Name-----along with-----> Senders email and Name
$From = $InstitutionDepartmentEmail ;
$FromName = $InstitutionName." ".$InstitutionDepartmentName ;
$sent = $swift->send( $message , new Swift_Address( $Department_email ), new Swift_Address( $From , $FromName ));
?>Thank you for sharing your time with me.
Dan Bloch
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]Code: Select all
<?php
echo "sorry about that tag issue, I'm a newbie";
?>