Click to See Complete Forum and Search --> : Dundas Mailer problem


zingmatter
04-07-2004, 06:34 PM
I keep being told :

'Object doesn't support this property or method'

when I try to send an email using the Dundas Mailer Control.

This is my code:

Set oMailer = Server.CreateObject("Dundas.Mailer")

With oMailer
.FromName = sFromName
.FromAddress = sFromAddress
.Organization = sClientName
.ReplyTOs = sReplyAddress
.Subject = sSubject
.HTMLBody = sBodyText
.TOs.add sendTo
.SendMail
End With

Is there anything obviously wrong here?

Thanks in advance

simflex
04-09-2004, 09:32 AM
what operating system do you have?
Are u restricted to using only dundas mailer?

There are unlimitless options to accomplishing the same thing you are attempting to do.
I haven't used dundas.

buntine
04-09-2004, 09:47 AM
What is the value of the 'sendTo' variable?
The 'add()' method requires a valid email address.

zingmatter
04-09-2004, 09:51 AM
It appears to be the only mail option available on the ISP we're using (Hostway). Although a colleague is working on JMail 4 or something on the same server which might offer a better alternative

Actually, I think I've sorted it. I had been testing for a failed mail by doing:

if oMailer.SendMail then
'//mail out ok
else
'//failed mail so
response.write("mail out failed")
end if

It seems that oMailer.SendMail always throws an exception, so you have to code:

on error resume next
oMailer.SendMail
if Err.No <> 0 then
response.write("Failed mail: " & Err.Descrition)
end if

Thanks anyway

buntine
04-09-2004, 12:00 PM
ahh, ok.. You could use a Try - Catch statement.

zingmatter
04-09-2004, 12:25 PM
I didn't know VBScript had a Try..Catch statement...shows how much I know
:o

Thanks