In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TCDOMAIL y Yahoo

Foro público de Xailer en español
Responder
Avatar de Usuario
XeviCOMAS
Mensajes: 582
Registrado: Sab Mar 12, 2011 8:16 pm

TCDOMAIL y Yahoo

Mensaje por XeviCOMAS »

Estoy intentando hacer funcionar el envio de mails para distintos servidores smtp, pero para el servidor Yahoo tengo problemas y no termina de funcionar correctamente.

Código: Seleccionar todo

   WITH OBJECT TCDOMail():New()
   :cSubject      := "PRUEBA"
   :cFrom         := "mimail@yahoo.com"
   :cUser         := "mimail@yahoo.com"
   :cPassword     := "miclaveapps"
   :cServer       := "smtp.mail.yahoo.com"
   :nPort         := 465
   :lAuthenticate := .T.
   :lSSL          := .T.

//Si no relleno estos campos me deja los mails en Borradores, y veo que "rellena" CC y BCC con campo vacío pero lo muestra en rojo de "error"
:cCC := "_@hotmail.com"  //Debo poner un mail Con Copia
:cBCC := "-@yahoo.com"//"-@hotmail.com" //Debo poner un mail Con Copia Oculta (distinto al CC)

   :cTO           := "mimail@gmail.com"
*   :lHTML         := ::oHtml:lChecked
   :cMessage      := "Texto de prueba"
*   :aAttachments  := { cFile }
   :Create()

   If :Send()
      MsgInfo( "OK", "ENVIO", mbOK,, IDI_INFORMATION )
   Else
      MsgStop( "KO", "ERROR", mbOK,, IDI_ERROR )
   EndIf
   END
Como comento, si no relleno los DOS campos cCC y cBCC con algun mail, salta a ERROR y Yahoo deja el mensaje en la carpeta Borradores.

¿Alguien está utilizando TCDOMAIL con algun cliente que utilize el servidor de correo de Yahoo???
Un Saludo,
Xevi.
Avatar de Usuario
bingen
Mensajes: 565
Registrado: Lun Jul 07, 2014 8:17 pm
Ubicación: Bilbao
Contactar:

Re: TCDOMAIL y Yahoo

Mensaje por bingen »

Lo siento Xevi, pero precisamente dejamos de usar CDO por que no nos funcionaba con ciertos servidores , por ejemplo aquellos que usan TTLS.
Ahora usamos cosas más "sofisticadas" como enviar con una clase de la librería de pago ChilKat aunque también hay una utilidad gratuita en línea de comandos SwithMail que funciona de maravilla.

Si te interesa cualquier aclaración sobre estas me las pides.
BiSoft Desarrollo de software profesional
http://www.bisoft.es
Luisen_xlr
Mensajes: 3
Registrado: Mar Feb 23, 2016 1:34 am

Re: TCDOMAIL y Yahoo

Mensaje por Luisen_xlr »

Puedes brindarme ayuda referente a SwithMail de preferencia, siendo usado por Xailer. ?

Gracias de Antemano
Avatar de Usuario
gabo1
Mensajes: 127
Registrado: Lun Oct 13, 2014 9:42 am

Re: TCDOMAIL y Yahoo

Mensaje por gabo1 »

Hola Luisen
Yo lo uso de esta manera.. quizas hay otros parmetros y mejores implementaciones pero por el momento me funciona

Código: Seleccionar todo

  IF Hb_FileExists( Application:cDirectory + "SwithMail\template_og.html" )
     xTemplate:= HB_MemoRead( Application:cDirectory + "SwithMail\template_og.html" )
     xTemplate:= StrTran( xTemplate, "#FOLIO_FACTURA#", ::cFolioFactura )
     xTemplate:= StrTran( xTemplate, "#NOMBRE_CLIENTE#", ::cNOM_Cliente )
     xTemplate:= StrTran( xTemplate, "#FECHA_HORA_FACTURA#", ::dFAC_FechaHora )
     xTemplate:= StrTran( xTemplate, "#NOMBRE_RESTAURANT#", AppData:cNameCompany )
     xTemplate:= StrTran( xTemplate, "#TELEFONOS#", ::cTEL_Empresa )
     xTemplate:= StrTran( xTemplate, "#EMAIL_EMISOR#", ::oSMTP_UserName:Value )
     xTemplate:= StrTran( xTemplate, "#LOGO_OREGANO#", cImgOG )
     xTemplate:= StrTran( xTemplate, "#LOGO_EMPRESA#", cImgCo )
     HB_MemoWrit( Application:cDirectory + "SwithMail\template_tmp.html", xTemplate )
  ENDIF
  cPlantilla:= HB_MemoRead( Application:cDirectory + "SwithMail\template_tmp.html" )
  // cXMLFile:= Application:cDirectory + 'SwithMail\SwithMailSettings.xml'

  hXML:= mxmlNewXML( "1.0" )
  hPtr:= mxmlNewElement( hXML, "SwithMailSettings" )

  hServer:= mxmlNewElement(hPtr, "ServerSettings")
        hNode:= mxmlNewElement(hServer, "FromName" )
        mxmlNewText( hNode, 0, AppData:cNameCompany )
        hNode:= mxmlNewElement(hServer, "FromAddress" )
        mxmlNewText( hNode, 0,AllTrim(::oED_Remitente:Value) )
        hNode:= mxmlNewElement(hServer, "Username" )
        mxmlNewText( hNode, 0, AllTrim(::oED_Remitente:Value) )
        hNode:= mxmlNewElement(hServer, "Password" )
        mxmlNewText( hNode, 0, AllTrim(::oSMTP_Password:Value) )
        hNode:= mxmlNewElement(hServer, "ObscurePassword" )
        mxmlNewText( hNode, 0, "False" )
        hNode:= mxmlNewElement(hServer, "MailServer" )
        mxmlNewText( hNode, 0, AllTrim(::oSMTP_Server:Value) )
        hNode:= mxmlNewElement(hServer, "MailServerPort" )
        mxmlNewText( hNode, 0, AllTrim(Str(::oSMTP_Port:Value)) )
        hNode:= mxmlNewElement(hServer, "SSL" )
        mxmlNewText( hNode, 0, IF( ::oRM_SSL:nIndex==1, "True", "False") )
        hNode:= mxmlNewElement(hServer, "RequestReceipt" )
        mxmlNewText( hNode, 0, "False" )
        hNode:= mxmlNewElement(hServer, "MessageID" )
        mxmlNewText( hNode, 0, "False" )

  hEmail:= mxmlNewElement(hPtr, "EmailAddresses")
     hNode:= mxmlNewElement(hEmail, "To" )
     mxmlNewText( hNode, 0, cToEmail )
     hNode:= mxmlNewElement(hEmail, "CC" )
     mxmlNewText( hNode, 0, cCCToEmail )

  hAttach:= mxmlNewElement(hPtr, "Attachments")
     hNode:= mxmlNewElement(hAttach, "AttachmentPath" )
     mxmlNewText( hNode, 0, cFileXML )
     hNode:= mxmlNewElement(hAttach, "AttachmentPath" )
     mxmlNewText( hNode, 0, cFilePDF )

  hConten:= mxmlNewElement(hPtr, "EmailContent")
     hNode:= mxmlNewElement(hConten, "HTML" )
     mxmlNewText( hNode, 0, "True" )
     hNode:= mxmlNewElement(hConten, "DontReplaceNewLine" )
     mxmlNewText( hNode, 0, "False" )
     hNode:= mxmlNewElement(hConten, "Subject" )
     mxmlNewText( hNode, 0, ::oED_Asunto:Value)
     hNode:= mxmlNewElement(hConten, "Body" )
     mxmlNewText( hNode, 0, cPlantilla)
     hNode:= mxmlNewElement(hConten, "Priority" )
     mxmlNewText( hNode, 0, "high")

  hLogg:= mxmlNewElement(hPtr, "Logging")
     hNode:= mxmlNewElement(hLogg, "Log" )
     mxmlNewText( hNode, 0, "True")

  mxmlSaveFile( hPtr, 'SwithMail\SwithMailSend.xml', MXML_NO_CALLBACK )

  cCommand:= Application:cDirectory + 'SwithMail\SwithMail.exe /s /x "'
  cCommand+= Application:cDirectory + 'SwithMail\SwithMailSend.xml"'

  cError:= OpenCommandMsDos(cCommand)

Responder