Help with objmessage email sending using authentication
Hi all, back again!
My host have changed authentication on their email server which has affected this script in my program. My emails now come back as undelivered. The script worked previous to these changes, so I am looking at this part of the code only (there is more code of course, but I am guessing this is where I need to make changes..
Code:
objmessage.TextBody = emailbody
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "my.smtp.server"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 0
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objmessage.Configuration.Fields.Update
objmessage.Send
Thanks in advance
Re: Help with objmessage email sending using authentication
"My host have changed authentication" - what changes have they made ?
Re: Help with objmessage email sending using authentication
If they actually are returned as undeliverable you have an entirely different kind of problem. It means the To address is wrong or a server along the path to the destination rejected the message.
Looking at the full headers of the bounced email might tell you why.
Re: Help with objmessage email sending using authentication
This is what I get:
host
x said: 551 This mail server requires
authentication before sending mail from a locally hosted domain. Please
reconfigure your mail client to authenticate before sending mail. (in reply
to MAIL FROM command)
Re: Help with objmessage email sending using authentication
Hi,
Looks like you have not specified the Recipient...
Code:
objmessage.From = txtFrom.Text
objmessage.To = txtTo.Text
objmessage.Subject = "Whatever.. Subject..."
objmessage.TextBody = eMailBody
Regards
Veena
Re: Help with objmessage email sending using authentication
Hi Veena, thanks for responding.
Apologies, I did not include more of the code further above, the recipient is included. I do not have access to the code from work, but will repost it all later, I only included that part as I assumed thats where the error would be.
Thanks again.
Re: Help with objmessage email sending using authentication
This is the rest of the code for this part
Code:
Set omsg = CreateObject("cdo.message")
Set omsg = Nothing
Set objmessage = CreateObject("CDO.Message")
' START EDIT HERE
objmessage.Subject = "my subject"
objmessage.From = "my email address"
objmessage.To = "destination emial address"
anotherday = Now
emailbody = "message body"
Re: Help with objmessage email sending using authentication
Re: Help with objmessage email sending using authentication
You may find that your mail relay demands POP-before-SMTP authentication now. You can't do this via CDO.
You'd need to authenticate via a POP3 connection first, and then for a small window of time the SMTP server will accept a connection from the same IP address. Sometimes this SMTP connection requires authentication too, but generally not.
This is meant to defeat people using SMTP bots and exploiting mail servers as relays, though many have simply accommodated to the new requirement.
Re: Help with objmessage email sending using authentication
Hi,
Entire code looks OK to me... I use similar code for GMail SMTP.. and it works perfectly..
without VB6, can you send/receive mails with your SMTP directly (I mean thru browser)...?
Regards
Veena
Re: Help with objmessage email sending using authentication
as suggested by veena, if you can no longer send via your default smpt server, try some free smpt server, like gmail or gmx, both work with cdo, settings posted in this forum, there are others