iis 7 - IIS 7 + Windows Server 2008 - Sending Emails from Classic ASP using CDO -
on our existing platform decided upgrade our development server windows server 2003 2008 time ago.
the problem facing asp scripts used send emails before when had windows server 2003 worked. now, stopped working no error on page or on smtp logs.
if use telnet send email manually works fine.
but it's not working our classic asp scripts.
this our asp code
sub sendemail(fromemail, toemail, ccemail, bccemail, subject, body, somefiles) set m_mailer = server.createobject("cdo.message") m_mailer.configuration.fields .item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 .item("http://schemas.microsoft.com/cdo/configuration/smptserver") = request.servervariables("server_name") .item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")=smtp_server_pickup_directory .update end if m_characterset <> "" m_mailer.bodypart.charset = m_characterset end if m_mailer.to = toemail m_mailer.cc = ccemail m_mailer.bcc = bccemail m_mailer.from = fromemail m_mailer.replyto = fromemail m_mailer.subject = subject if m_usehtmlformat m_mailer.htmlbody = fixtext(body) else m_mailer.textbody = fixtext(body) end if dim somefiles = split(somefiles, vbtab) = 0 ubound(somefiles) m_mailer.addattachment(somefiles(i)) next m_mailer.send end sub
i've checked permissions on mailroot folder , iis user has full control. i've set relay 127.0.0.1, , gave iis user access smtp well.
when use telnet on log , receive email correctly.
but when using test script don't email, stay stuck on pickup folder
dim emailer set emailer = new emailhelper emailer.sendemail "test@test.com", "fede@shocklogic.com", "", "", "test 1 2 3 " & request.servervariables("http_host"), "test...", "" set emailer = nothing response.write "done"
when try execute test script "done" on page, no email.
smtp installed , enabled.
any great
found solution! (at least works me)
i removed line
.item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")=smtp_server_pickup_directory
and configured smtp in iis 7 console use localhost instead of pickup directory , works perfect now!
Comments
Post a Comment