473,378 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Not being able to send mails through PHP using SMTP

Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much

Jan 3 '07 #1
7 7703

oo********@hotmail.com wrote:
Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much
The Apache and PHP version shouldn't matter. I've written a short
tutorial on congifuring mail for PHP here:
http://www.neilang.com/2006/12/php-sending-html-emails/

To test the connection to the SMTP server from your computer you could
try to telnet straight to the SMTP server from command prompt.
Otherwise I recommend installing the mail server that comes with XP Pro
and setting that as your mail server. I've used this before and it
works great with PHP4 after some configuration.

Jan 4 '07 #2
oo********@hotmail.com wrote:
Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much
I would be VERY surprised if they don't require any authentication.
This would leave them wide open to spammers, and within minutes of being
discovered they would be on every spam blacklist in the world.

Rather, I suspect the person who indicated they don't require any
authentication doesn't know what they're talking about.

There are a couple of commonly used ways to authenticate for outbound
mail - one is to require a userid/password to sign on to send email.
Another is to require you to check your POP3/IMAP mailbox first.
Checking that could give your IP address (i.e.) 30 minutes of outbound
mail without authentication. Then you would have to check your incoming
mailbox again.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 4 '07 #3
Hi,

Thank you for your response.

I looked into the site you have provided and I assure you that my code
to use the mail(..) is 100% correct. I have also consulted other sites
for the correct use of the mail(..) functions. I have set the necessay
PHP variables for this.

As you had suggested: I used the "telnet" program and when I try to
connect to my ISP's SMTP server through the telnet it fails. I
contacted my ISP and they also don't know the anwser on telnet's
failure. I asked them about authentication requirement and they said no
authentication is required. One thing is strange in that if I sent
mails through MS-OUTLOOK all mails are sent correctly and received at
the other end.

It seems I am lost here...

Noodle wrote:
oo********@hotmail.com wrote:
Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much

The Apache and PHP version shouldn't matter. I've written a short
tutorial on congifuring mail for PHP here:
http://www.neilang.com/2006/12/php-sending-html-emails/

To test the connection to the SMTP server from your computer you could
try to telnet straight to the SMTP server from command prompt.
Otherwise I recommend installing the mail server that comes with XP Pro
and setting that as your mail server. I've used this before and it
works great with PHP4 after some configuration.
Jan 4 '07 #4
Hi,

Further information:

I know a personal acquaintaince who works for the ISP.I talked to him
and he assures that no authentication is needed. He is also a PHP
programmer. Perhaps being inside the ISP's intranet he doesn't require
one.

When I try the telnet command "open" with the ISP's SMTP address and
the port 25, the function returns so abruptly (within a blink of an
eye) with a connection failure message. But when tried with different
port address (23) it takes some time for the failure message to come.
Maybe this means something.

I am using the email account from my ex-ISP. It requires username and
password. When I use MS-OUTLOOK I access the ex-ISP through the current
ISP. So in the MS-OUTLOOK the POP3 is that of my ex-ISP and the SMTP is
of the current ISP

Jerry Stuckle wrote:
oo********@hotmail.com wrote:
Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much

I would be VERY surprised if they don't require any authentication.
This would leave them wide open to spammers, and within minutes of being
discovered they would be on every spam blacklist in the world.

Rather, I suspect the person who indicated they don't require any
authentication doesn't know what they're talking about.

There are a couple of commonly used ways to authenticate for outbound
mail - one is to require a userid/password to sign on to send email.
Another is to require you to check your POP3/IMAP mailbox first.
Checking that could give your IP address (i.e.) 30 minutes of outbound
mail without authentication. Then you would have to check your incoming
mailbox again.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 4 '07 #5
oo********@hotmail.com wrote:
Jerry Stuckle wrote:
>>oo********@hotmail.com wrote:
>>>Hello everyone,

I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My
machine is using Windows XP 2002 professional edition which comes with
a Windows firewall. I am using McAfee free edition for anti-virus.

I use an ISP provider from my country and according to them I do not
need to perform authentication while sending mails through their SMTP
address. Thus I am using external SMTP server. I don't have IIS
installed in my computer nor do I have an SMTP server running.

I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.

Thinking that I may have somehow messed up the header information or
not properly using CRLF, I used the phpmailer class. The classes have
been installed properly.

The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.

I debugged the phpmailer class and the fsockopen(..) function fails as
you can also see from the above error message.

fsockopen function returns false.

The $errno = 10053 and the $errstr = "An established connection was
aborted by a software in your host machine"

Again disabling the firewall and McAfee the same error is reported.

Could the reason for the problem be that I am using quite old PHP and
Apache version. I searched the entire php.net sites but the exact
problem is not faced by anyone. I guess no one uses Apache 1.3.33
anymore. Could the incompatibility between Apache and PHP causing this?

Any help would be appreciated very much

I would be VERY surprised if they don't require any authentication.
This would leave them wide open to spammers, and within minutes of being
discovered they would be on every spam blacklist in the world.

Rather, I suspect the person who indicated they don't require any
authentication doesn't know what they're talking about.

There are a couple of commonly used ways to authenticate for outbound
mail - one is to require a userid/password to sign on to send email.
Another is to require you to check your POP3/IMAP mailbox first.
Checking that could give your IP address (i.e.) 30 minutes of outbound
mail without authentication. Then you would have to check your incoming
mailbox again.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Hi,

Further information:

I know a personal acquaintaince who works for the ISP.I talked to him
and he assures that no authentication is needed. He is also a PHP
programmer. Perhaps being inside the ISP's intranet he doesn't require
one.

When I try the telnet command "open" with the ISP's SMTP address and
the port 25, the function returns so abruptly (within a blink of an
eye) with a connection failure message. But when tried with different
port address (23) it takes some time for the failure message to come.
Maybe this means something.

I am using the email account from my ex-ISP. It requires username and
password. When I use MS-OUTLOOK I access the ex-ISP through the
current ISP. So in the MS-OUTLOOK the POP3 is that of my ex-ISP and
the SMTP is of the current ISP
(Top posting fixed)

Yep, it means the connection is being rejected by your ISP. I'm not
sure why it would do so before it got any data - but that looks like the
problem.

Check your SMTP parms in Outlook very carefully. Ensure that you're
accessing the correct server. Some ISP's have their mail servers on a
different system.

P.S. Please don't top post. Thanks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 4 '07 #6
>I know a personal acquaintaince who works for the ISP.I talked to him
>and he assures that no authentication is needed. He is also a PHP
programmer. Perhaps being inside the ISP's intranet he doesn't require
one.
SMTP servers for a domain (e.g. the one the MX record is pointed
at) typically accept mail from anywhere (except hosts on the SPAM
block list) if the destination is for the domain being served
(subject to later filtering for SPAM and viruses). They may also
allow IP addresses local to the ISP itself to send mail out to
anyone. Neither requires authentication (but roaming customers not
connecting via the ISP's own network have a problem) to avoid
horrible spam abuse. (except by their own customers). The approach
of "POP before SEND" also doesn't require authentication on sending
mail, but requires you to check your mailbox within some time (e.g.
an hour) before sending.
>When I try the telnet command "open" with the ISP's SMTP address and
the port 25, the function returns so abruptly (within a blink of an
eye) with a connection failure message. But when tried with different
port address (23) it takes some time for the failure message to come.
Maybe this means something.
When I try telnet to the given server address in the original post,
and port 25, it connects and gives a SMTP banner. I doubt it's
operating as an open relay, but I did not test that.
I tried the PHP's mail(...) function but the function fails. It reports
that the connection to the SMTP host cannot be made. I set the SMTP
host using the ini_set function as well as editing the php.ini and
specifying the host (then again restarting Apache server). This doesn't
help. The mail function still fails with the same error. Disabled the
Windows firewall and McAfee anti-virus. But the same problem persists.
I'd like to suggest firewall problems, either on your end or between
you and the SMTP server.
The phpmailer's send(..) function also fails with the error:

Debug Warning: C:\Program Files\Pcounter Web
Report\www\libraries\class.smtp.php line 177 - fsockopen(): unable to
connect to smtp.wlink.com.np:25

I am using the default port that is 25. Verified that my ISP provider
also uses port 25 for SMTP.
My experiments with telnet suggest that I can get a SMTP banner
using the above information, so the server is (at the moment) working.

Jan 5 '07 #7
Thank you all for your responses.

The problem is solved. The telnet succeeds as well as the mail
function. The problem was the McAfee antivirus. I am using the free
perpetual edition. Only disabling it was not enough. I completely
uninstalled it and restarted my computer. Now everything is good.
However now I am without an antivirus program.. lol...

As for the authentication scheme to avoid spamming, according to my ISP
it allows only 100 emails per hour by a user. If a user sends 100
emails within 5 minutes then he has to wait 1 hour more to again send
100 emails. Hope I am not doing any harm revealing my ISP's secret.:)

Jan 5 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Prashanth | last post by:
Hi, I am sending mails using CDO.Message . It is sending mails successfully only if the destination addresses are within the intranet. If you try to send a mail outside the intranet say...
29
by: | last post by:
I did a working code with CDONTS on NT4 Now I am testing is on w2k and it looks like objCDONTS.Send is completely ignored. I think is it ignored because it throws no errors, neither does the...
58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
1
by: Nigel | last post by:
I know there are lots of threads covering my question but i am still unable to send e-mails from an asp.net page. Messages are not even going into the logs. Here is the code that i am using to...
0
by: jlconde | last post by:
I have a classe to send mails. It runs on yahoo well but with hotmail I never receive the mails.I do not receive an error neither. I would need some strange header to make the hotmail like my...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
5
by: Sin Jeong-hun | last post by:
Hi. I would like to let users send bug reports or other messages to me. Maybe the easiest way to send e-mails from my application is just use the default e-mail agent by executing a link...
3
by: BLUE | last post by:
I want to send an email from my web service. I do not want to act like an email client, giving credentials of an existing email account to send messages: I would like to send my mail directly to...
13
by: btreddy | last post by:
Hii all, I've been searching in the internet just to know abt SMTP server. Can anybody tell me how to configure the SMTP server and how can i send the mails and how could i check whether...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.