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

Home Posts Topics Members FAQ

Accessing SMTP direct instead of using mail()

My shared web host has made some sort of upgrade to .. something .. the
support tech can't tell me what. It's a cPanel system, with all the
regular stuff. The site is a club site.

For years, I have been using the regular old mail(...) function for
things like sending broadcast messages to members. Yesterday, that
failed. The host now tells me I need to access the SMTP server directly,
using a valid email account and password. "It's a new security measure
to prevent spamming. Go find a script," was the tech's reply.

I found one, at:
http://us3.php.net/manual/en/ref.mail.php
2/3rds down, search the page for:
josephcmiller2 at gmail dot com

Port 25 doesn't work; the tech finally told me to try port 587. That
helps. No authentication is required, he said. However, the script fails
at:

// Say hello...
fputs($cp, "HELO ".$GLOBAL["SMTP_SERVE R"]."\r\n");
$res=fgets($cp, 256);
if(substr($res, 0,3) != "250") return "Failed to Introduce";

...and I don't know what to do after that. $GLOBAL["SMTP_SERVE R"]
contains the name of the server, ("mail.example. com") which works for
the fsockopen() code preceding the HELO lines. Any ideas, folks?

--
-bts
-Friends don't let friends drive Windows
Jun 27 '08 #1
13 1813
Beauregard T. Shagnasty wrote:
My shared web host has made some sort of upgrade to .. something .. the
support tech can't tell me what. It's a cPanel system, with all the
regular stuff. The site is a club site.

For years, I have been using the regular old mail(...) function for
things like sending broadcast messages to members. Yesterday, that
failed. The host now tells me I need to access the SMTP server directly,
using a valid email account and password. "It's a new security measure
to prevent spamming. Go find a script," was the tech's reply.

I found one, at:
http://us3.php.net/manual/en/ref.mail.php
2/3rds down, search the page for:
josephcmiller2 at gmail dot com

Port 25 doesn't work; the tech finally told me to try port 587. That
helps. No authentication is required, he said. However, the script fails
at:

// Say hello...
fputs($cp, "HELO ".$GLOBAL["SMTP_SERVE R"]."\r\n");
$res=fgets($cp, 256);
if(substr($res, 0,3) != "250") return "Failed to Introduce";

..and I don't know what to do after that. $GLOBAL["SMTP_SERVE R"]
contains the name of the server, ("mail.example. com") which works for
the fsockopen() code preceding the HELO lines. Any ideas, folks?
Get phpmailer. It handles all of that.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '08 #2
Jerry Stuckle wrote:
Beauregard T. Shagnasty wrote:
>My shared web host has made some sort of upgrade to ..

Get phpmailer. It handles all of that.
I looked at that during my search. It appears to me it needs to be
installed on the *shared* web host, and I don't see how I can do that.

(The search also turned up some results that said
http://www.swiftmailer.org/
is even better, but the same restrictions apply.)

I can't do this on my home PC as there is an online associated members'
database maintained by the membership chairman of the year, who also
needs to use some of the mailing functions. Club officers also have some
access to certain functions.

--
-bts
-Friends don't let friends drive Windows
Jun 27 '08 #3
..oO(Beauregard T. Shagnasty)
>Jerry Stuckle wrote:
>Beauregard T. Shagnasty wrote:
>>My shared web host has made some sort of upgrade to ..

Get phpmailer. It handles all of that.

I looked at that during my search. It appears to me it needs to be
installed on the *shared* web host, and I don't see how I can do that.
Just upload it to some directory on your host and include the two
classes in your script, that's all. No further installation necessary.
The configuration can be set at runtime.

Micha
Jun 27 '08 #4
Beauregard T. Shagnasty wrote:
Jerry Stuckle wrote:
>Beauregard T. Shagnasty wrote:
>>My shared web host has made some sort of upgrade to ..
Get phpmailer. It handles all of that.

I looked at that during my search. It appears to me it needs to be
installed on the *shared* web host, and I don't see how I can do that.

(The search also turned up some results that said
http://www.swiftmailer.org/
is even better, but the same restrictions apply.)

I can't do this on my home PC as there is an online associated members'
database maintained by the membership chairman of the year, who also
needs to use some of the mailing functions. Club officers also have some
access to certain functions.
Nope, you can put it on your website then include the classes. It works
fine with shared hosts. If you have access to the directory below your
webroot, I recommend placing it there (where I place all include files).
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '08 #5
the problem with normal classes is, that they all cant handle the TLS
encoding google wants you to use. Because of this google rejects the
connection. I dont know whether phpmailer can handle this but normal
scripts, you find will only work with other smtp servers
Jun 27 '08 #6
Martin wrote:
the problem with normal classes is, that they all cant handle the TLS
encoding google wants you to use. Because of this google rejects the
connection. I dont know whether phpmailer can handle this but normal
scripts, you find will only work with other smtp servers
He's not using gmail, so the point is moot. But phpmailer does handle
TLS security quite well.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '08 #7
On Tue, 3 Jun 2008 11:08:33 -0700 (PDT), Martin wrote:
the problem with normal classes is, that they all cant handle the TLS
encoding google wants you to use. Because of this google rejects the
connection. I dont know whether phpmailer can handle this but normal
scripts, you find will only work with other smtp servers
http://www.xpertmailer.com/ as referenced at
http://us2.php.net/manual/en/ref.mail.php#82433

Is there anything else you need on this silver platter?

--
88. If a group of henchmen fail miserably at a task, I will not berate them
for incompetence then send the same group out to try the task again.
--Peter Anspach's list of things to do as an Evil Overlord
Jun 27 '08 #8
Peter H. Coffin wrote:
On Tue, 3 Jun 2008 11:08:33 -0700 (PDT), Martin wrote:
>the problem with normal classes is, that they all cant handle the TLS
encoding google wants you to use. Because of this google rejects the
connection. I dont know whether phpmailer can handle this but normal
scripts, you find will only work with other smtp servers

http://www.xpertmailer.com/ as referenced at
http://us2.php.net/manual/en/ref.mail.php#82433

Is there anything else you need on this silver platter?
Hey,
I've written a tutorial on doing this with pear mail, with uthentication
and tls, and without.

http://phpmaniac.net/wiki/index.php/...ing_using_SMTP

leigh
Jun 27 '08 #9
Michael Fesser wrote:
.oO(Beauregard T. Shagnasty)
>>Jerry Stuckle wrote:
>>Beauregard T. Shagnasty wrote:
My shared web host has made some sort of upgrade to ..

Get phpmailer. It handles all of that.

I looked at that during my search. It appears to me it needs to be
installed on the *shared* web host, and I don't see how I can do
that.

Just upload it to some directory on your host and include the two
classes in your script, that's all. No further installation
necessary. The configuration can be set at runtime.
I've been playing with phpmailer. After some modification - and
rewriting some of the mailing scripts/pages - it works after a fashion.
Heh, 90-something KB to replace one mail() line.

Oh, and this. I just got a 'followup' from the tech guy, who says, "Your
normal php mail() function should now be working."

Duh... Last night I wasn't allowed to use it.

--
-bts
-Friends don't let friends drive Windows
Jun 27 '08 #10

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

Similar topics

6
3833
by: Fernando M. | last post by:
Hi, i made a test with smtplib module a few days ago, for sending mails, and i was wondering if there's another module for running an SMTP server, so i could make a standalone script for sending mails without using an external SMTP server. I've been searching but i'm not sure if there are modules for it, or anything. Which ones are my options? Thanks.
9
4311
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
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,
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
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
10040
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
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...
0
8713
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...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.