PHPMailer error: "unable to connect to :25" - php

When I was trying to send an email using the PHPMailer class, I had the following error:
Warning: fsockopen() [function.fsockopen]: unable to connect to :25 (No connection could be made because the target machine actively refused it. ) in C:\Users\Testing\Downloads\PHPMailer\phpmailer\class.smtp.php on line 105
Can anyone help me?

unable to connect to :25 is an indication that you forgot to enter a server address in the configuration.
Make sure you are specifying a valid SMTP server address when initializing PHPMailer.

Related

SMTP service (gmail) is not working in opencart. its returning an error every time

I am going to use gmail in opencart as SMTP but its returning error in in every page where email is to sent some where. Like when new user register instead of going to account page or when someone submit contact form the folloing error appears.
Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) in /public_html/system/library/mail.php on line 153Notice: Error: Connection refused (111) in public_html/system/library/mail.php on line 156
Following are the configuration I have done in opencart mail setting.
I have allowed unsecure appes and gone through the google DisplayUnblockCapcha.
but its still not working.
any help please...!!

Cannot connect to mail server with phpmailer

I try to open php mailer file to text it and it says this:
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Do you guys know how to fix it?
Try to turn on Access for less secure apps for your gmail. Suggest to use a new e-mail to do it. Because it is less secure.
https://support.google.com/accounts/answer/6010255?hl=en

imap is not connecting to mail server from live server but working fine from localhost

I could connect to a mail server from my localserver my when I uploaded that file to a server I am getting the following error
Notice: Unknown: rsh to IMAP server timed out (errflg=1) in Unknown on line 0
Notice: Unknown: Connection failed to mail.xxxxxxxxxxxxxxxxxxxx.com,143: Connection refused (errflg=2) in Unknown on line 0
Please help Thanks
Try using the ip address to connect instead of the domain name (mail.xxxxxxxxxxxxxxxxxxxx.com).
Is your server behind a firewall or a NAT router ? Otherwise does it resolve to the same IP when you try to look it up from the remote and local host ? Check with:
nslookup mail.xxxxxxxxxxxxxxxxxxxx.com
Server may miss or have broken libraries.
If you have a ssh-connection at server you could try to open an IMAP-connection over telnet. (Initiated from server).
Just google "telnet imap" and try a login. If success, library error, if no success. Firewall?

php codeigniter mail function not working

i wa trying to do mail with php codeigner, but unfortunately its not working. the error which i got was the following; somebody please help me..
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to localhost:8025 (Connection refused)
Filename: libraries/smtp.php
Line Number: 105
Thanks in advance
Ahamed
Apparently you are trying to connect to port 8025, and this fails. The default smtp port is 25, so either you used the wrong port number or there is no mail service running on port 8025 on localhost, but whatever the cause this is something you should probably change in your configuration somewhere.
Another option is to change the mail protocol from smtp to native php mail, refer to the CodeIgniter docs on how to do this (and make sure you set this up correctly - especially if you are using Windows, check php.ini).

Unable to Connect error with Zend_Rest_Client on localhost

I am using Zend_Rest_Client to connect Zend_Rest_Server, everything seems to be alright, but when I try to get() from the server I recieve this error:
Zend_Http_Client_Adapter_Exception:
Unable to Connect to
tcp://localhost:80. Error #10060: 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.
in
C:\www\zf_1_72\library\Zend\Http\Client\Adapter\Socket.php
on line 148
here is code, which I use
$client = new Zend_Rest_Client('http://localhost/my_application/api/index/');
$client->auth($key);
$result = $client->get();
thank's for any advice
This thread suggetss the issue may be with the 'localhost' name - try using 127.0.0.1 instead.

Categories