473,769 Members | 6,126 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
13 1814
..oO(Beauregard T. Shagnasty)
>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.
You'll soon learn that PHPMailer is much more powerful and far more
convenient than the simple mail() function, where you would have to do a
lot of things by hand, especially if you want to send multi-part mails.

The only things that I don't like about PHPMailer are some of the method
names, which are misleading. For example isHtml() shouldn't set the used
mode, but just return a TRUE or FALSE. Anyway, such things are easy to
fix with a wrapper class if necessary, the rest is just working fine.

Micha
Jun 27 '08 #11
Beauregard T. Shagnasty wrote:
Michael Fesser wrote:
>.oO(Beaurega rd 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.
Hmmm, not sure why you had to rewrite some of the scripts. The couple
of times I've used it it's worked fine. But you must have some really
off-the-wall requirements from your host.

Interesting that now mail() works. They must have had a bunch of
complaints from their users.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '08 #12
Michael Fesser wrote:
.oO(Beauregard T. Shagnasty)
>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.

You'll soon learn that PHPMailer is much more powerful and far more
convenient than the simple mail() function, where you would have to
do a lot of things by hand, especially if you want to send multi-part
mails.
I'll agree it's powerful. However, it far exceeds my needs, which
consist only of sending short text messages^1 to broadcast events to our
members, to confirm registrations (about 150 ten-line messages per
summer), a little members-only "forum", and the contact page. There are
never attachments nor embedded graphics, for example.

But I'll still do some more experimenting with it.

1. HTML is for web pages <g>

--
-bts
-Friends don't let friends drive Windows
Jun 27 '08 #13
Jerry Stuckle wrote:
Interesting that now mail() works. They must have had a bunch of
complaints from their users.
It worked for one run of a half-dozen individual messages to rally
registrants.

Then it failed on a broadcast of coming events to the club members. Club
email address in TO: and a hundred members in BCC:. That script is
unmodified for years.

I reopened the trouble ticket. :-(

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

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

Similar topics

6
3834
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
18270
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
9589
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
9423
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
10045
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
8872
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
7409
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
6673
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
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
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.