Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when sending emails

Status
Not open for further replies.

Greenleaf

Programmer
Feb 14, 2002
93
IT
Hello,
I have read many posts suggesting how to solve the infamous email problem.
I get this error:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

I tried many codes but things don't work.

Code:
Set cdoConfig = Server.CreateObject("CDO.Configuration")

With cdoConfig

.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "194.243.154.62"

 .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25

  .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2

  .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 60

  .Fields.Update

End With

 Set MiaMail = Server.CreateObject("CDO.Message")
  MiaMail.Configuration = cdoConfig 

  MiaMail.From = "mymail@mymail.it"
  MiaMail.To = "mymail@mymail.it" 
  MiaMail.Subject = "richiesta servizio"
  MiaMail.HtmlBody = "L'utente con partita IVA nr. "&p_iva&" ha richiesto di accedere ai servizi: <br>"&track&"<BR>"&documenti
  MiaMail.Fields.Update()
  MiaMail.Send
  Set MiaMail = Nothing
Set cdoConfig= Nothing
 
I mean, I don'e have a server running locally, I found out the number 194.243.154.62 on a webpage and it should be mail.tin.it which is my smtp server
 
I am trying many codes, now this one works but only if I send the email to myself, if I try with different emails it doesn't work. I don't know what to do.
Code:
<%Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoSendUsingExchange = 3

Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2


 

  Dim Message 'As New CDO.Message '(New - For VBA)
  
 
  Set Message = CreateObject("CDO.Message")

 
  With Message.Configuration.Fields
    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendemailaddress")[/URL] = "sara@mail.it"

    'SMTP settings - without authentication, using standard port 25 on host smtp
    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = cdoSendUsingPort
    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "mail4.interhost.it" 

    'SMTP Authentication
    '.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")[/URL] = 0

    .Update
  End With

  'Set other message fields.
  With Message
    'From, To, Subject And Body are required.
    .From = "sara@mail.it"
   .To = "sara@mail.it"
	
    .Subject = "muffa"
    .TextBody = "uffa"  
    
 
    .Send
  End With

  'Returns zero If succesfull. Error code otherwise 
  SendMailByCDO = Err.Number

%>
 
It works sending email to yourself but not to others?

Perhaps there is an issue within the mail server that is preventing the mail from being delivered? Perhaps it will only relay a message if the FROM specifieds an account on its server?
 
It turned out that the server I was using didn't allow email sending, although I have yet to figure out why I could send email to myself.
 
The problems has now slightly changed.
The code has been tested on two servers. One of them works smoothly and the emails are sent, the second one gives this error.

CDO.Configuration.1
Interface not registered

The final code I use is :

Code:
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoSendUsingExchange = 3

Set Message = CreateObject("CDO.Message")

With Message.Configuration.Fields

    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = cdoSendUsingPort
    .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "mail.posta.it"  


    .Update
  End With

  With Message
 .from=ecc
 ecc

 end with

is the problem with cdoSendUsingport?? or an authentication problem? i cannot figure out.
 
It sounds like you're missing a DLL file or an ActiveX file that may not be properly registered on the second machine. A quick Google search for "cdo Interface not registered" may help to provide some more answers.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
I have looked at it but I couldn't be able to find anything useful; the cdosys.dll is correctly registered, are there other libraries to be checked/registered?
 
The only thing that they have told me is that they are in different domains.
 
After many questions they gave me the answer.
The functioning server is win server 2003 with cdosys.dll version number 6.5.6757
The other server (not working) is xp with cdosys.dll version number 6.2.4.0.

Do someone know the differences between these two servers for this purpose?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top