Bulk Mail using SMTP

29 views
Skip to first unread message

Peter

unread,
Apr 29, 2008, 10:42:15 PM4/29/08
to mimemessage-dev
Hi

Successfully implemented this on a Linux server and then decided that
I needed to do the same on a Windows Server using SMTP.

So

Added the classes:
require("../../classes/mime/smtp.php");
require("../../classes/mime/smtp_message.php");

Created the Class & set the SMTP Variables:
$email_message=new smtp_message_class;
$email_message->host_name="mail.aapt.net.au";
$email_message->host_port=25;
$email_message->ssl=0;
$email_message->localhost="localhost";
$email_message->direct_delivery=0;
$email_message->timeout=10;
$email_message->data_timeout=0;
$email_message->debug=1;
$email_message->html_debug=1;
$email_message->pop3_auth_host="";
$email_message->user="";
$email_message->realm="";
$email_message->password="";
$email_message->workstation="";
$email_message->authentication_mechanism="";

Everything else is the same as the Linux Bulk Mail App, which works.

The Windows one failed because:
Send() retains $this->host_name as mail.aapt.net.au- OK
StartSendingMessage() thinks $this->host_name is localhost- NO GOOD.

I fixed it by adding a line in StartSendingMessage() setting $this-
>smtp_host="mail.aapt.net.au";
It then worked.

Any Ideas?

Thanks. This is a really good PHP Class.

Peter Miller



Manuel Lemos

unread,
Apr 30, 2008, 1:21:02 AM4/30/08
to mimemes...@googlegroups.com
Hello,

on 04/29/2008 11:42 PM Peter said the following:

smtp_host is a class variable that you can set to whatever SMTP server
domain you want.

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Peter

unread,
Apr 30, 2008, 1:50:40 AM4/30/08
to mimemessage-dev
OK

But why do I have to set it in StartSendingMessage()? Why doesn't
StartSendingMessage() retain the the same class variable value as
Send() does?
> PHP professionals looking for PHP jobshttp://www.phpclasses.org/professionals/
>
> PHP Classes - Free ready to use OOP components written in PHPhttp://www.phpclasses.org/- Hide quoted text -
>
> - Show quoted text -

Manuel Lemos

unread,
Apr 30, 2008, 2:02:53 AM4/30/08
to mimemes...@googlegroups.com
Hello

on 04/30/2008 02:50 AM Peter said the following:


> OK
>
> But why do I have to set it in StartSendingMessage()? Why doesn't
> StartSendingMessage() retain the the same class variable value as
> Send() does?

You should not use the StartSendingMessage because it is private and so
it is not documented. You need to use the Send function to send the message.

Peter

unread,
Apr 30, 2008, 2:54:17 AM4/30/08
to mimemessage-dev
I use the Send function. Send() calls StartSendingMessage(). In the
Send() function $this->host_name is 'mail.aapt.net.au'. As soon as
StartSendingMessage() is called by the Send() function, $this-
>host_name resolves to 'localhost'.

On Apr 30, 4:02 pm, Manuel Lemos <mle...@acm.org> wrote:
> Hello
>
> on 04/30/2008 02:50 AM Peter said the following:
>
> > OK
>
> > But why do I have to set it in StartSendingMessage()? Why doesn't
> > StartSendingMessage() retain the the same class variable value as
> > Send() does?
>
> You should not use the StartSendingMessage because it is private and so
> it is not documented. You need to use the Send function to send the message.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP professionals looking for PHP jobshttp://www.phpclasses.org/professionals/

Manuel Lemos

unread,
Apr 30, 2008, 3:04:33 AM4/30/08
to mimemes...@googlegroups.com
Hello,

on 04/30/2008 03:54 AM Peter said the following:


> I use the Send function. Send() calls StartSendingMessage(). In the
> Send() function $this->host_name is 'mail.aapt.net.au'. As soon as
> StartSendingMessage() is called by the Send() function, $this-
>> host_name resolves to 'localhost'.

The right variable to set is smtp_host. There is no host_name variable.
That is of the SMTP object, which is private and you should not be
poking it.

Peter

unread,
Apr 30, 2008, 4:22:28 AM4/30/08
to mimemessage-dev
So where do I set smtp_host? As you can see from above, I set
$email_message->host_name="mail.aapt.net.au"; Should I have set
$email_message->smpt_host="mail.aapt.net.au";?

I am not trying to poke it, just trying to get it to work. My poke
worked.

I should be able to set a global SMPT mail server without having to
modify smpt_message.php.

Regards

Peter

On Apr 30, 5:04 pm, Manuel Lemos <mle...@acm.org> wrote:
> Hello,
>
> on 04/30/2008 03:54 AM Peter said the following:
>
> > I use the Send function. Send() calls StartSendingMessage(). In the
> > Send() function $this->host_name is 'mail.aapt.net.au'. As soon as
> > StartSendingMessage() is called by the Send() function, $this-
> >> host_name resolves to 'localhost'.
>
> The right variable to set is smtp_host. There is no host_name variable.
> That is of the SMTP object, which is private and you should not be
> poking it.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP professionals looking for PHP jobshttp://www.phpclasses.org/professionals/

Manuel Lemos

unread,
Apr 30, 2008, 4:42:29 AM4/30/08
to mimemes...@googlegroups.com
Hello,

on 04/30/2008 05:22 AM Peter said the following:


> So where do I set smtp_host? As you can see from above, I set
> $email_message->host_name="mail.aapt.net.au"; Should I have set
> $email_message->smpt_host="mail.aapt.net.au";?

If you read the documentation, you do not need to wonder reading the
source. Only the smpt_host variable is documented and is the one to
use. The host_name variable is not even of this package, it is of the
SMTP class.

Reply all
Reply to author
Forward
0 new messages