Enviar datos por email
Publicado por Pancho (15 intervenciones) el 27/04/2001 18:07:45
Quisiera desde mi aplicación mandar datos por e-mail. Entre los datos a mandar iria una foto en JPG. Como puedo hacerlo
Gracias
Gracias
Valora esta pregunta


0



Sub EnviarCorreo()
Dim objOutlook As Object
Dim objMail As Object
Dim strMensaje As String
Dim strAsunto As String
Dim strDestinatario As String
Dim strAdjunto As String
'Iniciar OutlookSet objOutlook = CreateObject("Outlook.Application")
'Crear un nuevo correoSet objMail = objOutlook.CreateItem(0)
'Establecer el destinatariostrDestinatario = "destinatario@email.com"
objMail.To = strDestinatario
'Establecer el asuntostrAsunto = "Asunto del correo"
objMail.Subject = strAsunto
'Establecer el mensajestrMensaje = "Este es el cuerpo del mensaje."
objMail.Body = strMensaje
'Establecer la imagen adjuntastrAdjunto = "C:\ruta\de\la\imagen.jpg"
objMail.Attachments.Add strAdjunto, 1, 0
'Enviar el correo objMail.Send 'Cerrar Outlook Set objMail = Nothing Set objOutlook = NothingEnd Sub

