By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

smtp connection

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
*** 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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.