Showing posts with label Classic ASP. Show all posts
Showing posts with label Classic ASP. Show all posts

Friday, April 16, 2010

Classic ASP on IIS 7, PDF on Windows 7

Vijay Pais was back again on a drowsy afternoon with certain other issues
He was on his way of migrating our Corporate Intranet.

Migration
Destination Server : Windows Server 2003, IIS 6.0, Oracle Express
Source Server: Windows 7, IIS 7.0, Oracle Express.

Issue 1: Classic ASP website not running on IIS 7.0.

By default, IIS 7.0 runs on Integrated Mode. It has to be changed to Classic for Clasic ASP to Run. And few other steps.

Alex Thissan has already put it on his web log.


But issues didnt leave us, were hooked on another interesting thing,

Issue2: PDF files not opening up on Windows 7.

Though the IIS 7 running on Windows 7 is configured for .pdf MIME types, it fails opening up the file. Microsoft accepts this issue in their knowledge base article and suggest a HOTFIX (KB: 979543) as resolution.


Requested microsoft for this fix file setup, got it installed and PDFs started opening up.

Happiness was back at faces, as there was minutes left out for the weekend bash.

Thursday, July 31, 2008

Send mails from a Remote host in Classic ASP

Situation: Your IIS is sitting in a machine A and Webmail is in a remote place say Machine B. To do send the mail from Classic ASP files inside the IIS, go with the below given method. Remember, the From Email id has to be a valid id and it's User Name and Password should be mentioned it the below given code.


Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM


Function SendMailNow(sFromEmail, sToEmail,sCcEmail, sSubject, sText)

Set myMail=CreateObject("CDO.Message")
myMail.Subject = sSubject
myMail.From = sFromEmail
myMail.To = sToEmail
myMail.cc = sCcEmail
myMail.HTMLBody = sText
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "202.151.190.XX"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server ONLY A VALID USER NAME, IT SHOULD EXIST
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"

'Your password on the SMTP server PASSWORD OF AN EXISTING USER NAME IN THAT REMORT MACHINE
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

'Server port (typically 25)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Use SSL for the connection (False or True)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

myMail.Configuration.Fields.Update

myMail.Send

Response.Write("Mail Sent")
Response.End



End Function

Send Mail from a Remote Host in Classic ASP

Situation: Your IIS is sitting in a machine A and Webmail is in a remote place say Machine B. To do send the mail from Classic ASP files inside the IIS, go with the below given method. Remember, the From Email id has to be a valid id and it's User Name and Password should be mentioned it the below given code.



<%
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM


Function SendMailNow(sFromEmail, sToEmail,sCcEmail, sSubject, sText)

Set myMail=CreateObject("CDO.Message")
myMail.Subject = sSubject
myMail.From = sFromEmail
myMail.To = sToEmail
myMail.cc = sCcEmail
myMail.HTMLBody = sText
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "202.151.190.XX"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server ONLY A VALID USER NAME, IT SHOULD EXIST
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"

'Your password on the SMTP server PASSWORD OF AN EXISTING USER NAME IN THAT REMORT MACHINE
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

'Server port (typically 25)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Use SSL for the connection (False or True)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

myMail.Configuration.Fields.Update

myMail.Send

Response.Write("Mail Sent")
Response.End



End Function

%>