Visual Basic para Aplicaciones - AYUDA POR FAVOR CON ESTA PEQUEÑA MODIFICACION

Life is soft - evento anual de software empresarial
 
Vista:

AYUDA POR FAVOR CON ESTA PEQUEÑA MODIFICACION

Publicado por alejandro (1 intervención) el 07/12/2013 18:05:47
Hola a todos, espero que alguien me pueda dar una manito ya que yo no conozco este lenguaje, tengo esta rutina
en vbscript que necesito utilizar en un programa que la llama pero no se como modificar al final de la rutina lo que detallo...

Por favor vean la funcion completa y al final de este post esta el detalle de la modificacion que necesito hacer en la ultima parte de la rutina

DESDE YA MIL GRACIAS A TODOS!!!!

Language=VBScript
Param=[%1]|Text|From:
Param=[%2]|Text|To:
Param=[%3]|Text|SMTP Server:
Param=[%4]|Text|User Name:
Param=[%5]|Text|Password:
Param=[%6]|Text|Message:
Param=[%7]|Text|Subject
Param=[%8]|Text|Use SSL ? ( YES / NO )
Param=[%9]|Text|Attachment
{End}
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "[%7]"
objMessage.From = "[%1]"
objMessage.To = "[%2]"
'objMessage.TextBody = "[%6]"
objMessage.HTMLBody = "[%6]"

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "[%3]"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[%4]"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "[%5]"


'Use SSL for the connection (False or True)

if "[%8]" = "NO" Then
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
else
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

'Server port 465
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
end if

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

If "[%9]" <> "" Then
objMessage.AddAttachment ("[%9]")
End If


objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==


AQUI ESTA LA CUESTION.... Y NO SE COMO MODIFICAR

On Error Resume Next


objMessage.Send

If Err.Number = 0 Then
msgbox "mail enviado satisfactoriamente ! ", vbInformation, " e-mail"
'Enviar_Mail_CDO = True
Else
MsgBox Err.Description, vbCritical, " Error al enviar el mail "
End If


Set objMessage = Nothing



Bien la modificacion que yo necesito es justo al final de la accion una vez que el correo ha sido enviado lo que hace actualmente es mostrar un cuadro de dialogo donde dice que fue enviado con exito o en su defecto que hubo un error...

Lo que yo necesito es que no muestre ningun cartel, que el error lo guarde en una variable en el clipboard de windows donde yo la pueda tomar y a su vezque si el correo salio satisfactoriamente me guarde la direccion de correo enviada en un archivo llamado exito.dat y si hubo error al enviar me la guarde en un archivo que se lleme error.dat
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder