Aqui les dejo la rutina que yo uso para hacer correos y agregar un attach , me funciona de mil maravillas.
saludos
try
loCfg = CREATEOBJECT("CDO.Message")
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 &'&&Send the message using the network (SMTP over the network).
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.m2cuadrados.com"
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 9025
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .f. &'&&Use SSL for the connection (True or False)
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
*' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 &'&&basic (clear-text) authentication
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="landmasters@m2cuadrados.com"
loCfg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="thx1138"
loCfg.Configuration.Fields.Update
&'End remote SMTP server configuration section==
loCfg.from = "mburle@landmasters.com.mx"
loCfg.to = correo1
loCfg.subject = thisform.edit1.Value
* aqui armo un mensaje en html para que salga en el correo del cliente de forma ordenada
amacro = '<b><font color="#CC0000">SI YA NO DESEAS RECIBIR ESTOS COMUNICADOS, POR FAVOR AVISANOS POR ESTE MEDIO PARA DARTE DE BAJA DEL SISTEMA</font></b><br>'
amacro = amacro + '<font size="1"><center>Este envio cumple con las disposiciones de legislacion sobre envio de correos en los paises que estan dentro del 105 Congreso Base de las Normativas Internacionales sobre Spam.<br><br></center>'
amacro = amacro + '<center>Solo reenvie este mail con el subject ELIMINAR y la direccion del mail donde lo recibio</center></font>'
amacro = amacro + '<br>'+thisform.edit2.Value+'<br><br>'
** le agrego el mensaje html al cuerpo del mensaje
loCfg.HTMLbody = amacro
loCfg.AddAttachment(archivo)
loCfg.send
espero les sirva
terça-feira, 5 de julho de 2011
[usuarios_fox] Un attach a un correo desde VFP sin necesidad de outlook o similares
__._,_.___
Comentarios, observaciones o si deseas darte de baja avísame a: jamorquecho@hotmail.com
.
__,_._,___
Nenhum comentário:
Postar um comentário