473,386 Members | 1,694 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,386 software developers and data experts.

smtp connection

Hi,

I am having difficulty connection to an smtp host. I am using the
following code but I don't think I fully understand what smtp host can
be used.

function setSMTPParams($host = null, $port = null, $helo = null, $auth
= null, $user = null, $pass = null)
{
if (!is_null($host)) $this->smtp_params['host'] = $host;
if (!is_null($port)) $this->smtp_params['port'] = $port;
if (!is_null($helo)) $this->smtp_params['helo'] = $helo;
if (!is_null($auth)) $this->smtp_params['auth'] = $auth;
if (!is_null($user)) $this->smtp_params['user'] = $user;
if (!is_null($pass)) $this->smtp_params['pass'] = $pass;
}

I don't fully understand that the $helo parameter is needed for.

Should I be able to access any smtp host which I own. I have two ISP
account and each have an smtp service. I use them for email. I notice
I can only use the smtp service associated with the ISP I am currently
connected to. Is that a common restriction which is the same reason I
am prevented from accessing the service from my php script?

Maybe the question I should this. What type of smtp account do I need
in order to send an email from my php script?

Thanks for any help.

Dan

Jul 17 '05 #1
2 2791
*** Dan Boyle escribió/wrote (Tue, 08 Mar 2005 12:38:25 -0500):
I don't fully understand that the $helo parameter is needed for.
Then you probably don't need to do a manual connection to the host. I bet
you just want to send mail: use mail() and you're done.

In case you need SMTP authentication, you have Pear's mail classes:

http://pear.php.net/package/Mail

Should I be able to access any smtp host which I own. I have two ISP
account and each have an smtp service. I use them for email. I notice
I can only use the smtp service associated with the ISP I am currently
connected to. Is that a common restriction which is the same reason I
am prevented from accessing the service from my php script?
Yes. Your ISP gets a connection from you and handles it according to its
policy. It doesn't know/care whether you're using Outlook Express or PHP.

Maybe the question I should this. What type of smtp account do I need
in order to send an email from my php script?


Anyone which accepts mail from your IP address and the From address you
want to use.
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #2
Dan Boyle wrote:
I am having difficulty connection to an smtp host. I am using the
following code but I don't think I fully understand what smtp host
can
be used.
Generally, the safest bet is to use the SMTP-server that your ISP
provides. An alternative method is to find the MX-record of the
recipient, and attempt to connect there. The latter will most likely
fail, since most of SMTP-servers these days refuse connections from
hosts that aren't either in their local network (the network it acts
MX for) or MX's for the network the connection is attempted from
(which rarely is the case).
I don't fully understand that the $helo parameter is needed for.
You should check RFC-821. It describes the different commands SMTP has
(at very least). To put it simply, HELO is the opening command for
SMTP-transmission channel, where the sender identifies itself to the
receiver.
Should I be able to access any smtp host which I own.
That depends solely on their configuration.
I have two ISP
account and each have an smtp service. I use them for email.
I hope this rings a bell :) You are attempting to send email from your
PHP script, are you not :D
I
notice I can only use the smtp service associated with the ISP I am
currently connected to.
As I said, this is generally the case.
Is that a common restriction
You need to blame the spammers for the need of this restriction ever
rising :(
which is the
same reason I am prevented from accessing the service from my php
script?
Hmm... I'm beginning to get the whole picture... your PHP-pages are
not hosted by the same company that provides you with email? If this
is the case, you need to find out the SMTP / MX (MaileXchanger)
responsible for *their* network and use that one - of course, they
might have blocked you from using that which leaves you with ...
nothing too usefull.
Maybe the question I should this. What type of smtp account do I
need
in order to send an email from my php script?


Since there are no stupid questions, here's a stupid answer: "Any one
that works for you should be just fine". The problem is always finding
one that does :)

--
Markku Uttula

Jul 17 '05 #3

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

Similar topics

1
by: David Hughes | last post by:
I wonder if anyone can help me resolve this problem. Although my ISP (One and One) provides the facility to run Python 2.2 CGI programs, their technical support people don't seem to have any Python...
4
by: Alex Hunsley | last post by:
I am using the smtp module to send emails via a local SMTP server on our network. I am failing with "connection refused" error, even though we definitely have an smtp server running on port 25! ...
21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
1
by: bivin | last post by:
hai i am requesting your technical support. please help me. i have been working with this for five days. the problem is relating with the smtp. i am trying to send an email from the asp.net...
0
by: Dan Sikorsky | last post by:
This is a C# console app using SMTP to send an email. The .EML file stays in the Queue folder because I close down the Internet Connection prematurely. What's the best way to keep the Internet...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
5
by: Chris | last post by:
I am trying to send email in C#. I wrote 2 pieces of code: 1. MailMessage mail = new MailMessage(); mail.From = "from_address"; mail.To = "to_address"; mail.Subject = "subject"; mail.BodyFormat...
7
by: oopsbabies | last post by:
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...
3
by: Sean Nakasone | last post by:
I'm having trouble with sending smtp mail. It's hanging after the smtplib.SMTP() line. It doesn't works from home but not from work. What's the best way to debug this? # Here's my script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.