473,756 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2811
*** 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
2909
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 expertise. I am trying to run Gypsymail.py as a CGI program from a web form. It is nearly all working, except for the part that I have reduced to the following code: #!/usr/bin/python # the line above must contain the path to Python on your...
4
25421
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! the code is like this: me = 'ahunsley@companyname.com' you = 'someonelse@companyname.com' msg = '*** alert'
21
3381
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. Nancy W
1
8041
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 page. earlier it was showing send using not find error.
0
2065
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 Connection live until the IIS server is done sending the email, as evidenced by the .EML file leaving the Queue folder. I can send email using C# and SMTP, but keep closing the connection before
34
18269
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 "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
5
23760
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 = MailFormat.Text; mail.Body = "body"; SmtpMail.SmtpServer = "smtp.server"; mail.Fields.Clear();
7
7742
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 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...
3
5260
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 import smtplib msg = "Subject: Hello\n\nThis is the\nbody of the message." server = smtplib.SMTP("smtp.gmail.com",465) # "Connection refused" normally means there is no server listening for # connections on the specified IP/port-combination.
0
9271
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.