Click to See Complete Forum and Search --> : Problem: Mail Not sent


javaNoobie
08-04-2004, 03:56 AM
<%
Dim strMessage , objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "p0212345@sp.edu.sg"
objCDO.To = "p0212345@sp.edu.sg"
objCDO.subject = "this is a test message"
objCDO.body = " This is your actual message in here"

if (objCDO.send) then
response.write("Mail Sent")
else
response.write("Mail Not Sent")
end if
%>


no prizes for guessing. it writes out 'Mail Not Send'. any1 knows whats the prob?? thx in advance

buntine
08-04-2004, 08:10 AM
Im not sure whether the send function returns a boolean... I thought it was just a sub-routine. If so, using it in an If Statement will always return false, or throw an exception.

Try removing the If Statement.

<%
Dim strMessage , objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "p0212345@sp.edu.sg"
objCDO.To = "p0212345@sp.edu.sg"
objCDO.Subject = "this is a test message"
objCDO.Body = " This is your actual message in here"
objCDO.Send
%>

Regards,
Andrew Buntine.

javaNoobie
08-04-2004, 09:47 PM
ok removed the if statement. no errors but mail does not get sent

javaNoobie
08-06-2004, 02:54 AM
ok removed the if statement. no errors but mail does not get sent

*ahem*.. sry.. been at this prob for a day now.. any idea where it might have went wrong?