|
pratyusha -> Transport failed to connect to server (9/24/2008 18:24:03)
|
Hi, I am tring to fix a bug in my website. When the user clicks to register to an event on the calendar after filling a form ...i get this error CDO.Message.1 error '80040213' The transport failed to connect to the server. C:\INETPUB\WWWROOT\CALENDAR\../includes/inc_sendmail.asp, line 120 This works fine in the live site but it doesnt work in the staging site(localhost) This is the code: function SendMail(fromname,fromemail,toemail,subject,body,htmlbody) Dim message ' The form message = body ' Email-Script on error resume next Select case emailtype case "ASPmail" Set objNewMail = Server.CreateObject("SMTPsvg.Mailer") objNewMail.FromName = FromName objNewMail.FromAddress = FromEmail ' the mail server goes below objNewMail.RemoteHost = MailServer objNewMail.AddRecipient toemail objNewMail.Subject = Subject objNewMail.BodyText = message SendOk = objNewMail.SendMail case "cdonts" Set objNewMail = Server.CreateObject ("CDONTS.NewMail") objNewMail.BodyFormat = 1 objNewMail.MailFormat = 0 'on error resume next '## Ignore Errors objNewMail.Send FromEmail, YourEmail, Subject, message case "jmail" set objNewMail = server.createobject("JMail.SMTPMail") objNewMail.Sender = FromEmail objNewMail.ServerAddress = MailServer objNewMail.AddRecipient toemail objNewMail.Subject = Subject objNewMail.Body = message objNewMail.execute case "ASPEmail" Set objNewMail = CreateObject("Persits.MailSender") objNewMail.From = FromEmail objNewMail.Host = MailServer objNewMail.AddAddress toemail objNewMail.Subject = Subject objNewMail.Body = message objNewMail.Send case "OCXmail" Set objNewMail = Server.CreateObject("ASPMail.ASPMailCtrl.1") SendEmail = objNewMail.SendMail(MailServer, YourEmail, FromEmail, Subject, message) Set objNewMail = Nothing end select if (err)then on error goto 0 SendMail = false else on error goto 0 SendMail = true end if end function function SendEmail(fromemail, toemail, subject, message) Dim ObjSendMail Set ObjSendMail = CreateObject("CDO.Message") 'This section provides the configuration information for the remote SMTP server. ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true 'Use SSL for the connection (True or False) ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password. ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="mail@gmail.com" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="proj" ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = toemail ObjSendMail.Subject = subject ObjSendMail.From = "mail01@gmail.com" ObjSendMail.HtmlBody = message ObjSendMail.Send Set ObjSendMail = Nothing if (err)then SendEmail = false else SendEmail = true end if end function %> Can anyone help me out here pls?
|
|
|
|