Question

So here is a fun one. Messages won't be sent for certain situations. Here's an instance that I found. Note that it doesn't produce an error.

Set objMail = server.CreateObject("CDO.Message")
Set obj_conf = server.CreateObject("CDO.Configuration")
Set obj_fields = obj_conf.Fields
obj_fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
obj_fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.school.edu.au"
obj_fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "0"
obj_fields("http://schemas.microsoft.com/cdo/configuration/smtserverpport") = "25"
obj_fields.Update
Set objMail.Configuration = obj_conf
objMail.From = """Person 1"" <Person1@school.edu.au>;"
objMail.ReplyTo = """Person 1"" <Person1@school.edu.au>;"
objMail.Subject = "school COMM TEST"
objMail.TextBody = "Comm testing" 
objMail.To = """Person 2"" <Person2@school.edu.au>;"
objMail.cc      = """My Name"" <myEmail@soemthing.com>;"
objMail.bcc       = """Person 2"" <Person2@school.edu.au>;"
objMail.AddAttachment "..\Attachment.htm"
objMail.send
Set objMail = Nothing
Set obj_conf = Nothing
Set obj_fields = Nothing

If I were to not add a ReplyTo or Attachment then it sends fine. There may be a few other combinations to get it to work. But why won't the current settings work, and why will it work without an attachment or without a ReplyTo? Thanks for any input!

Was it helpful?

Solution

After looking at their attachment I noticed they had a line with: <br><br> I replaced them, along with the other tags with: <br /> and it now works. Very interesting, strange and convoluted issue. But glad its over!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top