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-
> 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?
smtp_host is a class variable that you can set to whatever SMTP server domain you want.
> > 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?
> smtp_host is a class variable that you can set to whatever SMTP server
> domain you want.
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:
> 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.
> 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.
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:
> 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.
> 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.