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
Tecnologia, programação e muito Visual FoxPro.
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
.
__,_._,___
Assinar:
Postar comentários (Atom)
Arquivo do blog
-
▼
2011
(2561)
-
▼
julho
(216)
- ]] XL-mania [[ fungsi untuk menampilkan data di ex...
- Re: [usuarios_fox] Off Topic Google+
- [usuarios_fox] Off Topic Google+
- [usuarios_fox] Re: codigo de barras
- RE: {Disarmed} [usuarios_fox] CALLER ID
- RE: [usuarios_fox] codigo de barras
- Re: ]] XL-mania [[ Isian Form Otomatis
- [usuarios_fox] codigo de barras... comentario
- Re: ]] XL-mania [[ Grafik Otomatis Susah!
- RE: {Disarmed} [usuarios_fox] CALLER ID
- Re: [usuarios_fox] VFP 9 y Crystal Report
- RE: {Disarmed} [usuarios_fox] CALLER ID
- RE: [usuarios_fox] codigo de barras
- RE: {Disarmed} [usuarios_fox] CALLER ID
- Re: [usuarios_fox] codigo de barras
- [usuarios_fox] VFP 9 y Crystal Report
- Re: ]] XL-mania [[ Isian Form Otomatis
- ]] XL-mania [[ select command button setelah enter...
- Re: ]] XL-mania [[ Tanya copy sheet keluar box
- Re: ]] XL-mania [[ membuat (semacam) tombol submit
- RE: ]] XL-mania [[ Grafik Otomatis Susah!
- Re: ]] XL-mania [[ Replace
- ]] XL-mania [[ Menghitung nilai secara terurai
- ]] XL-mania [[ mengolah data pesanan
- Re: ]] XL-mania [[ Replace
- Bls: ]] XL-mania [[ membuat (semacam) tombol submit
- Re: ]] XL-mania [[ Cara mengkonversi tanggal angka...
- Re: ]] XL-mania [[ membuat (semacam) tombol submit
- Re: ]] XL-mania [[ Replace
- Re: ]] XL-mania [[ Replace
- Re: ]] XL-mania [[ Pengurangan dan conditional for...
- ]] XL-mania [[ Membuat Database Biodata Siswa
- Re: ]] XL-mania [[ Pengurangan dan conditional for...
- Re: ]] XL-mania [[ Isian Form Otomatis
- ]] XL-mania [[ Replace
- Bls: ]] XL-mania [[ Belajar Looping
- ]] XL-mania [[ Grafik Otomatis Susah!
- ]] XL-mania [[ Pengurangan dan conditional formati...
- ]] XL-mania [[ membuat (semacam) tombol submit
- ]] XL-mania [[ menambahkan grafik pada diagram
- ]] XL-mania [[ Isian Form Otomatis
- ]] XL-mania [[ Cara mengkonversi tanggal angka dan...
- ]] XL-mania [[ Rekapitulasi Mingguan
- ]] XL-mania [[ Minta Tolong makro di Excel 2007 Error
- ]] XL-mania [[ define picture
- ]] XL-mania [[ Tanya copy sheet keluar box
- ]] XL-mania [[ Naga Bonar Pakai Makro Excell
- ]] XL-mania [[ File - rules_and_tips
- Re: ]] XL-mania [[ menghitung premi/ha berdasarkan...
- Bls: ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya s...
- Re: ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya sa...
- Re: ]] XL-mania [[ Password berubah-ubah
- Re: ]] XL-mania [[ menghitung premi/ha berdasarkan...
- Re: ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya sa...
- Bls: ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya s...
- Bls: ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya s...
- Re: ]] XL-mania [[ Tag Customer otomatis
- Re: ]] XL-mania [[ Menyisipkan koma di depan 2 ang...
- ]] XL-mania [[ menghitung premi/ha berdasarkan kap...
- ]] XL-mania [[ Password berubah-ubah
- ]] XL-mania [[ Bolak balik A1 & A2 Hasilnya sama saja
- Re: ]] XL-mania [[ Menyisipkan koma di depan 2 ang...
- ]] XL-mania [[ Tag Customer otomatis
- Re: ]] XL-mania [[ Belajar membuat data base
- RE: ]] XL-mania [[ Menambahkan Makro Cancel
- ]] XL-mania [[ Belajar membuat data base
- Bls: ]] XL-mania [[ Dropdown dipakaikan lookup dulu
- Re: ]] XL-mania [[ Cetak Form
- Re: ]] XL-mania [[ Split data per sheet
- Re: ]] XL-mania [[ Urutan Angka
- Re: ]] XL-mania [[ Split data per sheet
- Bls: ]] XL-mania [[ Urutan Angka
- Re: ]] XL-mania [[ Cetak Form
- Re: ]] XL-mania [[ Overtime calculation
- Re: ]] XL-mania [[ Menyisipkan koma di depan 2 ang...
- Re: ]] XL-mania [[ Urutan Angka
- Re: ]] XL-mania [[ Menyisipkan koma di depan 2 ang...
- ]] XL-mania [[ Split data per sheet
- Bls: ]] XL-mania [[ penjumlahan dalam hlookup (men...
- ]] XL-mania [[ Cetak Form
- ]] XL-mania [[ Urutan Angka
- RE: ]] XL-mania [[ panjang karakter tetap
- Bls: ]] XL-mania [[ panjang karakter tetap
- ]] XL-mania [[ ask: program exel untuk least square
- Re: ]] XL-mania [[ panjang karakter tetap
- Re: ]] XL-mania [[ panjang karakter tetap
- ]] XL-mania [[ Menyisipkan koma di depan 2 angka p...
- Re: ]] XL-mania [[ Dropdown dipakaikan lookup dulu
- ]] XL-mania [[ Overtime calculation
- Re: ]] XL-mania [[ penjumlahan dalam hlookup (meng...
- ]] XL-mania [[ paparkan jumlah type mengikut kehen...
- Re: ]] XL-mania [[ penjumlahan dalam hlookup (meng...
- Bls: ]] XL-mania [[ penjumlahan dalam hlookup (men...
- Re: ]] XL-mania [[ Apa yang salah yah... mohon di ...
- Re: ]] XL-mania [[ cara meratakan-ratakan range te...
- Bls: ]] XL-mania [[ lagi-lagi cari sisa DO
- Re: ]] XL-mania [[ Re: Menjumlah angka-angka prime...
- Re: ]] XL-mania [[ Memberi tanda perulangan
- Re: ]] XL-mania [[ cara meratakan-ratakan range te...
- Re: ]] XL-mania [[ lagi-lagi cari sisa DO
-
▼
julho
(216)
Nenhum comentário:
Postar um comentário