Forum Moderators: open

Message Too Old, No Replies

A problem with linux/chillisoft & cdonts

         

fintan

10:52 am on Jan 13, 2003 (gmt 0)

10+ Year Member



I been working on this for a bit now trying different ways to send mail.

<%
On Error resume Next
Dim mailer
CR = Chr(13)
Set mailer = Server.CreateObject("CDONTS.NewMail")
If IsObject (mailer) Then
mailer.Host = "mail.server.ie"
mailer.From = rsEmail.Fields.Item("Name").Value
mailer.To = rsEmail.Fields.Item("Email").Value
mailer.Subject = "Subject"
mailer.Body = "body with some variables"
mailer.Importance = 1 (Normal)
mailer.value("Reply-to")=""
mailer.Send
Set mailer = nothing
Response.Write("Message sent")
Else
Response.Write("Message not sent")
End If

%>

The name and email is dynamically done. The email is ment to be optional say when someone clicks on a link the email is processed. Now chillisoft has been enabled to send mail.
The email server is a lotus machine.

Now here is the question does anything need to be done to the linux box, does it need to point to the email server or is my code at fault.

Thanks

jpjones

4:44 pm on Jan 13, 2003 (gmt 0)

10+ Year Member



Hi Fintan,
The above code looks correct - it's very similar to what I use on some of the boxes I manage. A few ideas for troubleshooting....

I always use the local machines' mail server to send out email - using the ip address 127.0.0.1 in "mailer.Host".

What happens when you execute the script - do you get
Message sent

or

Message not sent

?

One thing to try - assuming you have access to the mail logs and have a local mail agent on the chiliasp box - change the host to localhost and see if the script causes a mail to be sent out.

Also try hardcoding all the From and To fields and see if you get any results then. Go back to basics to make sure it works, and then include the dynamically submitted variables from forms....

fintan

10:47 am on Jan 14, 2003 (gmt 0)

10+ Year Member



I was going to the use the liux box to send the email, but I'm new to it so hunting down the correct file is taken a bit of time.

In the url it shows "Message sent" but no message is recieved and no error is displayed but for a 404 page not found.

I've also modified the code to see what happens, still with the same results.

I dont think its chillisoft, I went though all the help files & I was on there site, Everything seems to be in order.

It could be the linux box or the way I'm useing the script with html. Within a '<a href="">Email</a>'

Any suggestions?

jpjones

11:25 am on Jan 14, 2003 (gmt 0)

10+ Year Member



If you are using localhost as the mail host, then
a) Are you sure you have a mail server running on the box?
(Try telnet <ip_of_box> 25 - you should get a prompt with a banner e.g.
220 <HOST> SMTP Sendmail

or something similar.)

b) Have you access to the logs? With linux, you should find the mail log at /var/log/maillog - look at the time you try to execute the script and see if the mail is being submitted. If you type tail -f /var/log/maillog in a shell prompt just before running the script - you should see the mail log in "real time".

c) What happens if you take out the line
On Error resume Next

of your code? This will stop the code from runnning and give you feedback as to which line is causing the problem.

JP

fintan

10:26 am on Jan 15, 2003 (gmt 0)

10+ Year Member



telnet <ip_of_box> 25 Connection failed

I'll have to figure out how to configure the linux box to send mail. I checked the logs like you said but to no joy.

fintan

10:30 am on Jan 15, 2003 (gmt 0)

10+ Year Member



Oh and heres the error

ADODB.Recordset.1 error '80020009'

Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.

/helpdesk/emailnotice.asp, line 39

jpjones

10:47 am on Jan 15, 2003 (gmt 0)

10+ Year Member



It sounds like you don't have the sendmail daemon (which handles email) running, which is why the telnet connection failed, and why your email isn't being sent out by Chiliasp when using localhost as the mail host.

If you're running RedHat (or a variant) you can start it by logging in as root and executing
/etc/rc.d/init.d/sendmail start

The ADODB.Recordset error does not have anything to do with the email part of the application. Is line 39 before or after the email code?

If you could sticky me with your code I'll take a look and try it one of my boxes to see if I can help.

Cheers,
JP

fintan

12:15 pm on Jan 15, 2003 (gmt 0)

10+ Year Member



"The ADODB.Recordset error does not have anything to do with the email part of the application."

I know, what I was doing was passing a parameter and filtering a recordset so the email would be dynamic along with some other values. That was before I hand coded the code. At the moment I'm using the Err.Object trying to debug it.

I'd sticky mail you the code but every bit of code is striped out by mailsweeper, the best I can is post it. Thanks for the advice on linux. I'm a newbie to linux so I'm just trying to get my head around it.

fintan

1:17 pm on Jan 15, 2003 (gmt 0)

10+ Year Member



Its working, some of the properties like "mailer.Send" it didn't like that now all I need to do is get the formatting right and I'm done.

Thanks

jpjones

1:35 pm on Jan 15, 2003 (gmt 0)

10+ Year Member



Glad you've got the problem licked! :)

JP