vbscript - Email is not sent -
i want send email vbscript code, below code working on machine, when changed machine, code no more able send email. there no errors or problems occurred during run, no emails sent/delivered. has else faced problem this?
set objmessage = createobject("cdo.message") objmessage .from = sendfrom .to = sendto .subject = "subject" .textbody = "" .htmlbody = "<b>body</b>" .configuration.fields .item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" .item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username" .item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password" .update end .send end
first, since didn't post entire code, check script doesn't contain line
on error resume next
if does: remove line , seek again.
if don't have line in script and script doesn't raise error and can telnet mailserver 25
it's mail service server accepted mail service delivery , problem somewhere upstream. check mail service server logs.
you can verify if server accepts mail service this:
c:\>
telnet mailserver 25
220 mailserver esmtp
helo clientname
250 mailserver
mail from:<joe.average@example.com>
250 2.1.0 ok
rcpt to:<joe.average@example.com>
250 2.1.5 ok
data
354 end info <cr><lf>.<cr><lf>
subject: test
test
.
250 2.0.0 ok: queued 4541e2227
quit
the line before quit
command means server accepted mail. actual response text may vary depending on mta used, every mta respond line when accepts message.
email vbscript qtp
No comments:
Post a Comment