Forum Moderators: open
<%
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
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....
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?
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
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
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.