0% found this document useful (0 votes)
70 views3 pages

Corregir Script Vbs Que Permita Enviar Email

This document contains a VBS script to send an email using SMTP authentication on port 465. It defines constants for the email sender/recipient, SMTP server details, authentication credentials, and email body. It then creates a CDO.Message object, configures the server settings, and sends the email, displaying success or error messages.

Uploaded by

Maria Cotto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views3 pages

Corregir Script Vbs Que Permita Enviar Email

This document contains a VBS script to send an email using SMTP authentication on port 465. It defines constants for the email sender/recipient, SMTP server details, authentication credentials, and email body. It then creates a CDO.Message object, configures the server settings, and sends the email, displaying success or error messages.

Uploaded by

Maria Cotto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CORREGIR SCRIPT VBS QUE PERMITA ENVIAR EMAIL

EmailSubject = "Sending Email by CDO"

EmailBody = "This is the body of a message sent via" & vbCRLF & _

"a CDO.Message object using SMTP authentication ,with port 465."

Const EmailFrom = "[email protected]"

Const EmailFromName = "Maria Cotto "

Const EmailTo = "[email protected]"

Const SMTPServer = "smtp.gmail.com"

Const SMTPLogon = "[email protected]"

Const SMTPPassword = "cristoteama1234"

Const SMTPSSL = True

Const SMTPPort = 465

Const cdoSendUsingPickup = 1 'Send message using local SMTP service pickup directory.

Const cdoSendUsingPort = 2 'Send the message using SMTP over TCP/IP networking.

Const cdoAnonymous = 0 ' No authentication

Const cdoBasic = 1 ' BASIC clear text authentication

Const cdoNTLM = 2 ' NTLM, Microsoft proprietary authentication

' First, create the message

Set objMessage = CreateObject("CDO.Message")

objMessage.Subject = EmailSubject

objMessage.From = """" & EmailFromName & """ <" & EmailFrom & ">"

objMessage.To = EmailTo

objMessage.TextBody = EmailBody

' Second, configure the server

objMessage.Configuration.Fields.Item _

Nombre: Maria Cotto Soliz


CORREGIR SCRIPT VBS QUE PERMITA ENVIAR EMAIL

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPLogon

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update

'Now send the message!

On Error Resume Next

objMessage.Send

If Err.Number <> 0 Then

MsgBox Err.Description,16,"Error Sending Mail"

Else

Nombre: Maria Cotto Soliz


CORREGIR SCRIPT VBS QUE PERMITA ENVIAR EMAIL

MsgBox "Mail was successfully sent !",64,"Information"

End If

Nombre: Maria Cotto Soliz

You might also like