|
| |
|
|
pratyusha
Posts: 3 Joined: 9/24/2008 Status: offline
|
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?
|
|
|
|
coreybryant
Posts: 2625 Joined: 3/17/2002 From: Castle Rock CO USA Status: offline
|
RE: Transport failed to connect to server - 9/25/2008 10:10:00
Are you wanting to use CDOSYS, ASPMail, JMail, OCXMa, etc? In most cases, one of these will suffice. You might check out Processing the Form with the JMail EMail Component if you want to use JMail. And don't forget, you will need an email server to help process the form.
_____________________________
Corey R. Bryant My Merchant Account Blog | Expression Web Blog
|
|
|
|
pratyusha
Posts: 3 Joined: 9/24/2008 Status: offline
|
RE: Transport failed to connect to server - 9/25/2008 12:02:35
Hi Thanks for the advice but I still don't know how to fix the issue. I havent written this code...I just have to fix it. Can you pls help me out?
|
|
|
|
pratyusha
Posts: 3 Joined: 9/24/2008 Status: offline
|
RE: Transport failed to connect to server - 9/25/2008 17:20:51
I am sorry, it is vice versa... The code is working on the staging site and not on the live site. Can you let me know what is wrong here? I have changed the username n password while posting
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|