OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Transport failed to connect to server

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Server Issues >> Transport failed to connect to server
Page: [1]
 
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

(in reply to pratyusha)
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?

(in reply to coreybryant)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Transport failed to connect to server - 9/25/2008 15:01:00   
The CDOSYS code you are using sends an email using the gmail smtp over a secure socket layer connection. You need to change these settings to reference your own local server if you want it to work locally. Why bother? If it works on the live server why do you need to have it work locally?

_____________________________

:)

Follow us on TWITTER

(in reply to pratyusha)
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

(in reply to pratyusha)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Transport failed to connect to server - 9/25/2008 18:17:42   
You need to set the Configuration.Fields to the correct smtp server name and port for your web site--generally start with something like this:

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") ="mail.yoursite.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)

_____________________________

:)

Follow us on TWITTER

(in reply to pratyusha)
Page:   [1]

All Forums >> Web Development >> Server Issues >> Transport failed to connect to server
Page: [1]
Jump to: 1





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