Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/02/2011, 16:03
mgd
 
Fecha de Ingreso: enero-2009
Mensajes: 129
Antigüedad: 15 años, 3 meses
Puntos: 0
sendmail y gmail

Hola utilizo un modulo de clase de sendmail (sendmail.cls), que descargue con un ejemplo, e intento enviar un mail con gmail.
Utilizo el servidor smtp.gmail.com, mi usuario y contraseña y también
.UseAuthentication = bAuthLogin (TRUE)
pero me da error:

Must issue a STARTTLS command firts.

Supongo que tiene que ver con SSL pero no encontre ninguna propiedad donde pueda poner SSL = True

Si utilizo un dominio propio que no requiere atentificacion ni SSL anda muy bien pero con gmail o hotmail no puedo hacerlo:

Este es el ejemplo:

Código vb6:
Ver original
  1. Gracias por su ayuda
  2.  
  3. Private Sub cmdSend_Click()
  4.  
  5.     ' *****************************************************************************
  6.     ' This is where all of the Components Properties are set / Methods called
  7.     ' *****************************************************************************
  8.  
  9.     cmdSend.Enabled = False
  10.     lstStatus.Clear
  11.     Screen.MousePointer = vbHourglass
  12.  
  13.     With poSendMail
  14.  
  15.         ' **************************************************************************
  16.         ' Optional properties for sending email, but these should be set first
  17.         ' if you are going to use them
  18.         ' **************************************************************************
  19.  
  20.         .SMTPHostValidation = VALIDATE_NONE         ' Optional, default = VALIDATE_HOST_DNS
  21.         .EmailAddressValidation = VALIDATE_SYNTAX   ' Optional, default = VALIDATE_SYNTAX
  22.         .Delimiter = ";"                            ' Optional, default = ";" (semicolon)
  23.  
  24.         ' **************************************************************************
  25.         ' Basic properties for sending email
  26.         ' **************************************************************************
  27.         .SMTPHost = txtServer.Text                  ' Required the fist time, optional thereafter
  28.         .From = txtFrom.Text                        ' Required the fist time, optional thereafter
  29.         .FromDisplayName = txtFromName.Text         ' Optional, saved after first use
  30.         .Recipient = txtTo.Text                     ' Required, separate multiple entries with delimiter character
  31.         .RecipientDisplayName = txtToName.Text      ' Optional, separate multiple entries with delimiter character
  32.         .CcRecipient = txtCc                        ' Optional, separate multiple entries with delimiter character
  33.         .CcDisplayName = txtCcName                  ' Optional, separate multiple entries with delimiter character
  34.         .BccRecipient = txtBcc                      ' Optional, separate multiple entries with delimiter character
  35.         .ReplyToAddress = txtFrom.Text              ' Optional, used when different than 'From' address
  36.         .Subject = txtSubject.Text                  ' Optional
  37.         .Message = txtMsg.Text                      ' Optional
  38.         .Attachment = Trim(txtAttach.Text)          ' Optional, separate multiple entries with delimiter character
  39.  
  40.         ' **************************************************************************
  41.         ' Additional Optional properties, use as required by your application / environment
  42.         ' **************************************************************************
  43.         .AsHTML = bHtml                             ' Optional, default = FALSE, send mail as html or plain text
  44.         .ContentBase = ""                           ' Optional, default = Null String, reference base for embedded links
  45.         .EncodeType = MyEncodeType                  ' Optional, default = MIME_ENCODE
  46.         .Priority = etPriority                      ' Optional, default = PRIORITY_NORMAL
  47.         .Receipt = bReceipt                         ' Optional, default = FALSE
  48.         .UseAuthentication = bAuthLogin             ' Optional, default = FALSE
  49.         .UsePopAuthentication = bPopLogin           ' Optional, default = FALSE
  50.         .Username = txtUserName                     ' Optional, default = Null String
  51.         .Password = txtPassword                     ' Optional, default = Null String, value is NOT saved
  52.         .POP3Host = txtPopServer
  53.         .MaxRecipients = 100                        ' Optional, default = 100, recipient count before error is raised
  54.         .SMTPPort = 587
  55.         ' **************************************************************************
  56.         ' Advanced Properties, change only if you have a good reason to do so.
  57.         ' **************************************************************************
  58.         ' .ConnectTimeout = 10                      ' Optional, default = 10
  59.         ' .ConnectRetry = 5                         ' Optional, default = 5
  60.         ' .MessageTimeout = 60                      ' Optional, default = 60
  61.         ' .PersistentSettings = True                ' Optional, default = TRUE
  62.         ' .SMTPPort = 25                            ' Optional, default = 25
  63.  
  64.         ' **************************************************************************
  65.         ' OK, all of the properties are set, send the email...
  66.         ' **************************************************************************
  67.         ' .Connect                                  ' Optional, use when sending bulk mail
  68.         .Send                                       ' Required
  69.         ' .Disconnect                               ' Optional, use when sending bulk mail
  70.         txtServer.Text = .SMTPHost                  ' Optional, re-populate the Host in case
  71.                                                     ' MX look up was used to find a host    End With
  72.     End With
  73.     Screen.MousePointer = vbDefault
  74.     cmdSend.Enabled = True
  75.  
  76. End Sub

También he probado esto mismo con un ocx llamado mail.ocx , no tiene la propiedad de SSL y me da el mismo error

gracias