topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Backup y Restore con MySqlDump
|
Horacio:
Enviado!
Saludos
|
Backup y Restore con MySqlDump
|
Muchísimas gracias Armando!
Saludos
|
Backup y Restore con MySqlDump
|
Horacio:
Gracias a ti por agradecer.
"Una de las mayores virtudes del hombre es la capacidad de demostrar agradecimiento"
Saludos
|
Backup y Restore con MySqlDump
|
Paisa y yo?
SysCtrlSoftware ARROBA Gmail.com
|
Backup y Restore con MySqlDump
|
Paisano:
Listo, tarde pero sin sueño.
Saludos
|
Backup y Restore con MySqlDump
|
Paisa no me llega
como te busco en el ese SKYPE,
<!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Backup y Restore con MySqlDump
|
Paisano:
Disculpa, Tenia yo un horror, enviado nuevamente.
Saludos
|
Backup y mysql
|
Amigos, estoy queriendo guardar un backup en un servidor remoto mysql. Todo funciona salvo cuando quiero recuperar el backup, el registro me devuelve 310 bytes menos que el original, por supuesto cuando quiero restaurar me dice que el backup está corrupto. E intentado con un campo longblob y longtext sin ningún resultado. Alguna pista donde mirar? Muchas gracias!.
Saludos
|
Backup y mysql
|
Hola Horacio.
Cómo estás haciendo el Backup?
Y cómo estás haciendo el Restore?
|
Backup y mysql
|
Horacio
Lo hago así:
Backup
[code=fw:1ldjaa7h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />C:\Archivos de programas\MySqlMaDB\bin\MySqlDump -h localhost -u root -pclave base>D:\Sistemas\rrhh\<span style="color: #00C800;">data</span>\bkrrhh.sql<br /> </div>[/code:1ldjaa7h]
Restore
[code=fw:1ldjaa7h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />C:\Archivos de programas\MySqlMaDB\bin\mysql -u root -pclave base<D:\Sistemas\rrhh\<span style="color: #00C800;">data</span>\bkrrhh.sql<br /> </div>[/code:1ldjaa7h]
|
Backup y mysql
|
Estoy usando FwMariaDb para conectarme con Mysql, pongo código, se va a entender mejor lo que quiero hacer
[code=fw:1vhis5eo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cBackup := Memoread<span style="color: #000000;">(</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\b</span>ackup<span style="color: #000000;">\b</span>ackup.sql"</span> <span style="color: #000000;">)</span><br />cUpdate := <span style="color: #ff0000;">"Update empresa set backup '"</span> + cBackup + <span style="color: #ff0000;">"' where codigo = 1"</span><br />oCon : <span style="color: #000000;">Execute</span><span style="color: #000000;">(</span> cUpdate <span style="color: #000000;">)</span> <br /> </div>[/code:1vhis5eo]
Quiero guardar el backup en un campo de una base de datos. Cuando hago la lectura de ese campo no me devuelve la longitud correcta, faltan 310 bytes.
|
Backup y mysql
|
Horario,
En principio en el update te falta el signo "="
[code=fw:6vnym22k]<div class="fw" id="{CB}" style="font-family: monospace;">cUpdate := <span style="color: #ff0000;">"Update empresa set backup = '"</span> + cBackup + <span style="color: #ff0000;">"' where codigo = 1"</span></div>[/code:6vnym22k]
De todos modos, no tiene por qué tener la misma cantidad de bytes el archivo que la cadena que se ve en el memoread.
Por otro lado, debes entender que en el query estarias grabando en el campo blob el contenido del archivo de texto .sql, (Ahora en el .sql puede haber un backup o un texto cualquiera)
No me parece que sea el mejor método para hacer un backup poner el backup en el campo de una tabla.
De todos modos, una forma más apropiada de insertar el archivo en el campo BLOB sería la siguiente.
[code=fw:6vnym22k]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cFile :=<span style="color: #ff0000;">"C:/backup/backup.sql"</span><br />cUpdate :=<span style="color: #ff0000;">"UPDATE empresa SET backup=LOAD_FILE('"</span>+cFile+<span style="color: #ff0000;">"') WHERE codigo=1"</span></div>[/code:6vnym22k]
En este ejemplo estaría insertando en el campo directamente el archivo, no el contenido del archivo.
Espero te sirvan los comentarios.
|
Backup y mysql
|
Hola Eduardo, gracias por tu respuesta, me olvide de poner el igual. Probaré tu solución. Con respecto al tamaño recuperado yo creo que si debería ser igual al backup original, de hecho es solo texto.
Saludos
|
Backup y mysql
|
Hummm meter un respaldo en un campo ? Salvo que la DB tenga muuuuy poca info !
La opcion de Ademar funciona muy bien, solo que tarda una eternidad la restauracion si la DB es mediana a grande !
En mi caso, uso lo siguiente :
- Verifico y detengo el servicio
[code=fw:3np8o5jp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> VrfMySrvSts<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oLoc, oWmi, oServiceList, oService, aSrvDts2Ret := <span style="color: #000000;">{</span>.f.,<span style="color: #ff0000;">""</span><span style="color: #000000;">}</span><br /><br />oLoc:= CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"wbemScripting.SwbemLocator"</span> <span style="color: #000000;">)</span><br />oWmi:= oLoc:<span style="color: #000000;">ConnectServer</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> oWmi == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"NO SE PUDO OBTENER INFO DEL MOTOR DE DATOS PARA GENERAR EL RESPALDO."</span>,<span style="color: #ff0000;">"AVISO"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> aSrvDts2Ret<br /><span style="color: #00C800;">endif</span><br /><br /><br />oServiceList := oWmi:<span style="color: #000000;">ExecQuery</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from Win32_Service where Name='MySQL'"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">for</span> each oService in oServiceList<br /> <span style="color: #00C800;">if</span> oService:<span style="color: #000000;">State</span> == <span style="color: #ff0000;">"Stopped"</span><br /> aSrvDts2Ret<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := .t.<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> oService:<span style="color: #000000;">State</span> == <span style="color: #ff0000;">"Running"</span><br /> oService:<span style="color: #000000;">StopService</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aSrvDts2Ret<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := .t.<br /> aSrvDts2Ret<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> := <span style="color: #ff0000;">"MySQL"</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aSrvDts2Ret<br /> </div>[/code:3np8o5jp]
- Ejecuto este programita similar al winzip o winrar desde linea de comandos
[code=fw:3np8o5jp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aBckUpDatDts<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> := <span style="color: #ff0000;">"c:<span style="color: #000000;">\R</span>epaldos"</span><br />aBckUpDatDts<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> := <span style="color: #ff0000;">"c:<span style="color: #000000;">\C</span>arpetaDeMySql"</span><br />cBckPFix := <span style="color: #ff0000;">"NombreDeTuRespaldo"</span> + <span style="color: #ff0000;">" "</span> <span style="color: #B900B9;">// Ojo en el espacio final sirve para separar los parametros !!!</span><br /><br />aSrvMyDts := VrfMySrvSts<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> aSrvMyDts<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> WaitRun<span style="color: #000000;">(</span> <span style="color: #ff0000;">"7za.exe a "</span> + aBckUpDatDts<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\r</span>sbck_"</span> + cBckPFix + aBckUpDatDts<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\D</span>ATA -pTuPassword"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// -p Para comprimir con password</span><br /><span style="color: #00C800;">endif</span><br /> <br /><br />- Arranco el servicio otra vez<br />WaitRun<span style="color: #000000;">(</span> <span style="color: #ff0000;">"sc start "</span> + aSrvMyDts<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">if</span> vrfSqlEngOn<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// Aqui nomalmente lo que hago es cerrar el programa y que vuelvan a entrar...</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:3np8o5jp]
[code=fw:3np8o5jp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> vrfSqlEngOn<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oLoc, oWmi, oServiceList, oService, lVal2Ret := .f.<br /><br />oLoc:= CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"wbemScripting.SwbemLocator"</span> <span style="color: #000000;">)</span><br />oWmi:= oLoc:<span style="color: #000000;">ConnectServer</span><br /><br /><span style="color: #00C800;">if</span> oWmi == <span style="color: #00C800;">nil</span><br /> DckMBox<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"NO FUE POSIBLE ARRANCAR EL MOTOR DE DATOS DESPUES DEL RESPALDO."</span>,,,, <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> lVal2Ret<br /><span style="color: #00C800;">endif</span><br /><br />oServiceList := oWmi:<span style="color: #000000;">ExecQuery</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"select * from Win32_Service where Name='MySQL'"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">for</span> each oService in oServiceList<br /> <span style="color: #00C800;">if</span> oService:<span style="color: #000000;">State</span> == <span style="color: #ff0000;">"Running"</span><br /> lVal2Ret := .t.<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> lVal2Ret<br /> </div>[/code:3np8o5jp]
El 7za.exe lo puedes encontrar sin problemas en google
Dependiendo de la pc, es posible que tengas que ejecutar como administrador.
Esto lo estoy usando desde hace años en DBs medianas ( 40 a 70 millones de registros ) sin ningun problemas hasta la fecha.
Espero les sirva.
Saludos
|
Backup y mysql
|
Amigos, finalmente desistí de guardar un backup en un campo de mysql. Opte por subir el backup directamente al servidor con pscp una utilidad de putty sumamente rápida y sencilla. Muchas gracias por sus respuestas.
Saludos
|
Backup/Restore MySQL data when build BAT file
|
Hi All
I use this code below:
[code=fw:3g0ry8hp]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">METHOD</span> RunDatabaseBackup<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TWinCraneErp<br /><span style="color: #00C800;">LOCAL</span> fp<br /><span style="color: #00C800;">LOCAL</span> chost := GetServer<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> names := <span style="color: #ff0000;">'utf8'</span><br /><span style="color: #00C800;">LOCAL</span> nport := <span style="color: #000000;">3306</span><br /><span style="color: #00C800;">LOCAL</span> db := GetLoginDataBase<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cDriver := CurDrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cDriverDir := GetCurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cdir := cDriverDir + <span style="color: #ff0000;">"<span style="color: #000000;">\B</span>ackUpData<span style="color: #000000;">\"</span> // cDriver + "</span>:\<span style="color: #ff0000;">" + cDriverDir + "</span>\BackUpData\<span style="color: #ff0000;">"<br />LOCAL cfile := 'BackupDatabase.sql'<br /><br /> fp:=FCREATE("</span>bak.bat<span style="color: #ff0000;">")<br /> WRITE(fp,"</span>@ECHO OFF<span style="color: #ff0000;">")<br /> FWRITE(fp,CRLF+"</span>mysqldump.exe --host <span style="color: #ff0000;">"+AllTrim(chost)+"</span> --default-character-set=<span style="color: #ff0000;">"+names+"</span> --port=<span style="color: #ff0000;">"+cvaltochar(nport)+"</span> -u root -p1234 <span style="color: #ff0000;">"+AllTrim(db)+"</span> > <span style="color: #ff0000;">"+alltrim(cdir)+iif(right(alltrim(cdir),1)=="</span>\<span style="color: #ff0000;">","</span><span style="color: #ff0000;">","</span>\<span style="color: #ff0000;">")+alltrim(cFile))<br /> FCLOSE(fp)<br /> WaitRun("</span>call bak.bat<span style="color: #ff0000;">",0)<br /><br />RETURN NIL<br /></span></div>[/code:3g0ry8hp]
[img:3g0ry8hp]http://www.fivetech.com.tw/downloads/img/fwh/2017-09-03_101114.jpg[/img:3g0ry8hp]
WaitRun("call bak.bat",0) => run it not work. If I windows file work fine.
Any solution be welcome!!
|
Backup/Restore MySQL data when build BAT file
|
Hi Richard,
Can you try it without "call"
WaitRun("bak.bat",0)
|
Backup/Restore MySQL data when build BAT file
|
Richard,
I use ShellExecute.
In your case it will be someting like this :
[code=fw:j0wfea0v]<div class="fw" id="{CB}" style="font-family: monospace;">ShellExecute<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'OPEN'</span>, <span style="color: #ff0000;">"cmd"</span> ,<span style="color: #ff0000;">"/c .<span style="color: #000000;">\m</span>ysqldump.exe --host "</span>+AllTrim<span style="color: #000000;">(</span>chost<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" --default-character-set="</span>+names+<span style="color: #ff0000;">" --port="</span>+cvaltochar<span style="color: #000000;">(</span>nport<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" -u root -p1234 "</span>+AllTrim<span style="color: #000000;">(</span>db<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" > "</span>+alltrim<span style="color: #000000;">(</span>cdir<span style="color: #000000;">)</span>+iif<span style="color: #000000;">(</span><span style="color: #0000ff;">right</span><span style="color: #000000;">(</span>alltrim<span style="color: #000000;">(</span>cdir<span style="color: #000000;">)</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span>==<span style="color: #ff0000;">"<span style="color: #000000;">\"</span>,"</span><span style="color: #ff0000;">","</span>\<span style="color: #ff0000;">")+alltrim(cFile), , 1 )</span></div>[/code:j0wfea0v]
|
Backup/Restore MySQL data when build BAT file
|
[quote="Horizon":2qehfgdg]Hi Richard,
Can you try it without "call"
WaitRun("bak.bat",0)[/quote:2qehfgdg]
HI Hakan,
You're right, work fine.
Thaks a lot.
|
Backup/Restore MySQL data when build BAT file
|
[quote="Marc Vanzegbroeck":3h0yh21d]Richard,
I use ShellExecute.
In your case it will be someting like this :
[code=fw:3h0yh21d]<div class="fw" id="{CB}" style="font-family: monospace;">ShellExecute<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'OPEN'</span>, <span style="color: #ff0000;">"cmd"</span> ,<span style="color: #ff0000;">"/c .<span style="color: #000000;">\m</span>ysqldump.exe --host "</span>+AllTrim<span style="color: #000000;">(</span>chost<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" --default-character-set="</span>+names+<span style="color: #ff0000;">" --port="</span>+cvaltochar<span style="color: #000000;">(</span>nport<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" -u root -p1234 "</span>+AllTrim<span style="color: #000000;">(</span>db<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" > "</span>+alltrim<span style="color: #000000;">(</span>cdir<span style="color: #000000;">)</span>+iif<span style="color: #000000;">(</span><span style="color: #0000ff;">right</span><span style="color: #000000;">(</span>alltrim<span style="color: #000000;">(</span>cdir<span style="color: #000000;">)</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span>==<span style="color: #ff0000;">"<span style="color: #000000;">\"</span>,"</span><span style="color: #ff0000;">","</span>\<span style="color: #ff0000;">")+alltrim(cFile), , 1 )</span></div>[/code:3h0yh21d][/quote:3h0yh21d]
Hi Marc,
you suggestion it and work fine.
Thanks a lot.
|
Backup/Restore MySQL data when build BAT file
|
FWH oCn:BackUp() is simple to use and works fast and well.
|
Backup/Restore MySQL data when build BAT file
|
[quote="nageswaragunupudi":2no8cnkc]FWH oCn:BackUp() is simple to use and works fast and well.[/quote:2no8cnkc]
Mr.Rao,
Yes, I think so. But now I use TMySQL 3rd
I have a idea. I can use TMySQL and FWH MariaDb/MySql Backup and Restore Together run it?
[code=fw:2no8cnkc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//TMySQL</span><br /><br /> oServer:= TMySQLServer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> GetServer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, GetLoginId<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, GetLoginPass<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> oServer:<span style="color: #000000;">NETERR</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServer:= TMySQLServer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> GetServer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"mysql"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> oServer:<span style="color: #000000;">NETERR</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MySQL????????????????????"</span>, <span style="color: #ff0000;">"??"</span> <span style="color: #000000;">)</span><br /> lOK := .F.<br /> <span style="color: #00C800;">RETURN</span> lOK<br /> <span style="color: #00C800;">ELSE</span><br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MySQL????????,?????????????"</span>, <span style="color: #ff0000;">"??"</span> <span style="color: #000000;">)</span><br /> lOK := .F.<br /> <span style="color: #00C800;">RETURN</span> lOK<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> cLoginTable := GetLoginDataBase<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServer:<span style="color: #000000;">SelectDB</span><span style="color: #000000;">(</span>cLoginTable<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//FWH MariaDb/MySql Backup and Restore</span><br /><br /> oCn := mysql_Connect<span style="color: #000000;">(</span> cHost, cUsr, cPsw<span style="color: #000000;">)</span><br /> ? cResult:=oCn:<span style="color: #000000;">Backup</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'prova'</span>,<span style="color: #ff0000;">'c:<span style="color: #000000;">\p</span>p<span style="color: #000000;">\p</span>rova.sql'</span><span style="color: #000000;">)</span><br /> ? oCn:<span style="color: #000000;">Restore</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>p<span style="color: #000000;">\p</span>rova.sql"</span>,<span style="color: #00C800;">NIL</span>,<span style="color: #00C800;">NIL</span>,<span style="color: #ff0000;">"prueba"</span><span style="color: #000000;">)</span> <br /> </div>[/code:2no8cnkc]
|
Backup/Restore MySQL data when build BAT file
|
[quote:pqesp8nk]I can use TMySQL and FWH MariaDb/MySql Backup and Restore Together run it?[/quote:pqesp8nk]
Yes, you can.
In fact you can use FWH mariadb functionality in addition to TMySql in your programs without any conflict with TMySql.
Your above program works.
However you can totally simplify the backup program and run it silently in the nights as a scheduled task and forget about it.
|
Backup/Restore MySQL data when build BAT file
|
You can use a simple program like this:
[code=fw:ey3ascz9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oCn<br /> <span style="color: #00C800;">local</span> cBackUpFolder := <span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>p<span style="color: #000000;">\"</span> // should end with a backslash<br /> <br /> FWCONNECT oCn HOST GetServer() USER GetLoginId() PASSWORD GetLoginPass() DATABASE GetLoginDataBase()<br /> if oCn == nil<br /> FWLOG "</span>Connect fail<span style="color: #ff0000;">"<br /> else<br /> oCn:BackUp( nil, cBackUpFolder )<br /> oCn:Close()<br /> oCn := nil<br /> endif<br /> <br />return nil<br /><br />// functions like GetServer() etc. <br /></span></div>[/code:ey3ascz9]
Make sure that the program does not contain any screen I/O.
Now add this to the scheduled tasks on the server (with user as SYSTEM) to run every night at your convenient time.
Assuming that your database name is "prova", this program will save backups each day in a different folder with weekday's name.
On Sunday night it saves backup as "c:\pp\Sunday\prova.sql". On Monday night it saves backup as "c:\pp\Monday\prova.sql" and so on. After one week, it overwrites that weekdays backup. This way we have 7 backups at any time.
|
Backup/Restore MySQL data when build BAT file
|
[quote="nageswaragunupudi":28s8wypk]You can use a simple program like this:
[code=fw:28s8wypk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oCn<br /> <span style="color: #00C800;">local</span> cBackUpFolder := <span style="color: #ff0000;">"c:<span style="color: #000000;">\p</span>p<span style="color: #000000;">\"</span> // should end with a backslash<br /> <br /> FWCONNECT oCn HOST GetServer() USER GetLoginId() PASSWORD GetLoginPass() DATABASE GetLoginDataBase()<br /> if oCn == nil<br /> FWLOG "</span>Connect fail<span style="color: #ff0000;">"<br /> else<br /> oCn:BackUp( nil, cBackUpFolder )<br /> oCn:Close()<br /> oCn := nil<br /> endif<br /> <br />return nil<br /><br />// functions like GetServer() etc. <br /></span></div>[/code:28s8wypk]
Make sure that the program does not contain any screen I/O.
Now add this to the scheduled tasks on the server (with user as SYSTEM) to run every night at your convenient time.
Assuming that your database name is "prova", this program will save backups each day in a different folder with weekday's name.
On Sunday night it saves backup as "c:\pp\Sunday\prova.sql". On Monday night it saves backup as "c:\pp\Monday\prova.sql" and so on. After one week, it overwrites that weekdays backup. This way we have 7 backups at any time.[/quote:28s8wypk]
Mr.Rao
Nice good job. Try it and add my plan code.
|
Backups MySql
|
Buenas
He visto conversaciones sobre copias de seguridad en el Foro usando TDolphin, y como fanático de git, tenéis otra opción que
quizás os sea de interés <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->
<!-- m --><a class="postlink" href="http://bicosyes.com/backup-incremental-de-tu-base-de-datos-con-git/">http://bicosyes.com/backup-incremental- ... s-con-git/</a><!-- m -->
|
Backups MySql
|
Thefull, al dar clik sobre el link. el explorer marca error: y se reinicia el explorer.
saludos...
|
Backups MySql
|
[url:3v2vjn7i]http://bicosyes.com/backup-incremental-de-tu-base-de-datos-con-git/[/url:3v2vjn7i]
|
Backups MySql
|
Amigos:
Ambos Links funcionan bien.
Willi, hace mucho que no te "veo" en el messenger?
Saludos
|
Backups into blu rays
|
Friends,
Does anyone use it and can you please share your experience?
I am looking for a high capacity read-only media that is immune to the plague of ransomwares.
Thank you very much and happy holidays!
|
Backups into blu rays
|
[quote="elvira":1ncu1yn1]Friends,
Does anyone use it and can you please share your experience?
I am looking for a high capacity read-only media that is immune to the plague of ransomwares.
Thank you very much and happy holidays![/quote:1ncu1yn1]
Many years ago Stephan Haupt made a cd copier but Me Haupt Is diede, another made a classe tò use CD nero but i never used It
|
Backups into blu rays
|
Thank you very much Silvio, I don't need to burn discs from Fivewin, but explore the possibility of making my own backups on a blu ray. Happy new year!!!
|
Backups into blu rays
|
Elvira,
have you seen my post?
One effective system for protecting data against ransomware is using an Offline Backup system.
Here's how it works:
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=37383&start=0&hilit=backup">viewtopic.php?f=3&t=37383&start=0&hilit=backup</a><!-- l -->
Best regards,
Otto
|
Backups into blu rays
|
Yes, thank you but i do not trust usb pendrives for backup i,m afraid
|
Backups into blu rays
|
Elvira,
I think one always needs multiple options to rely on. Trust also strongly depends on experiences. At the beginning, I invested a lot of money in a tape drive, and during the first backup, it chewed up the tape. With CDs, I've personally seen one shatter into a thousand pieces. Overall, I think one always needs a functioning system where data can be immediately read back. Technology changes so fast. I use Synology systems as an additional backup, but my main backups are those where I can access the files without additional software.
Best regards,
Otto
|
Backups into blu rays
|
Elvira, what I do: Always 2 HARD DISKs of 500 megabytes or higher. 1 Pendrive(USB) Exclusive for backup copies of my systems. And of course, I store (backup) everything important in my file cloud:
Elvira, lo que hago: Siempre 2 DISCOS DUROS de 500 megas o más. 1 Pendrive(USB) Exclusivo para copias de seguridad de mis sistemas. Y, por supuesto, almaceno (copia de seguridad) todo lo importante en mi nube de archivos:
Create an account at:
Crea una cuenta en:
[url:2015whqz]https://mega.nz/[/url:2015whqz]
Reagrds, saludos.
|
Backups into blu rays
|
João, may I ask if you have personally seen a PC or server infected with ransomware?
Best regards,
Otto
|
Backups into blu rays
|
[quote="Otto":35u88rdn]João, may I ask if you have personally seen a PC or server infected with ransomware?
Best regards,
Otto[/quote:35u88rdn]
this is the typical example when one asks one thing and everyone wants to impose another thing on you, ignoring what the author of the topic asked!!!!
Please the topic Is "backup on bluray"
|
Backups into blu rays
|
Silvio,
"Always 2 HARD DISKs of 500 megabytes or higher. 1 Pendrive (USB) exclusive for backup copies of my systems."
that has nothing to do with a secure backup.
For example, there are always times when the data is in one place.
If there is a ransomware attack, it encrypts both disks and the backup.
Do you know how ransomware software works?
Best regards,
Otto
|
Backups into blu rays
|
[quote="Otto":2uiv1ek4]Silvio,
"Always 2 HARD DISKs of 500 megabytes or higher. 1 Pendrive (USB) exclusive for backup copies of my systems."
that has nothing to do with a secure backup.
For example, there are always times when the data is in one place.
If there is a ransomware attack, it encrypts both disks and the backup.
Do you know how ransomware software works?
Best regards,
Otto[/quote:2uiv1ek4]
Please respect the topic!!!
|
Backups into blu rays
|
Silvio,
This is the question:
Does anyone use it and can you please share your experience?
I am looking for a high capacity read-only media that is immune to the plague of ransomwares.
|
Backups into blu rays
|
Thank you very much. Indeed, we already use backups on internal and external hard disk. It is a question of analyzing the complementary Blu ray option. The tapes are very expensive, given the price of the recorder.
|
Backups into blu rays
|
hi,
Lifetime of Optical Disk depend Disk Material so don´t buy No-Name Disk
also "write once" Disk life longer than "read/write" Disk
but you need a Hardware "Burner/Player" which modern PC don´t have any more
since we got USB-Stick i use them for "quick" Backup
there are also USB-Stick which have a Switch to enable/disable "Write"
[url:1ew6h5yl]https://www.amazon.de/Netac-64GB-Flash-Drive-Geh%C3%A4use-wei%C3%9F/dp/B0872V8P1Q/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=MME614CITXOO[/url:1ew6h5yl]
|
Backups into blu rays
|
[quote="Otto":cmsotfn4]Silvio,
This is the question:
Does anyone use it and can you please share your experience?
I am looking for a high capacity read-only media that is immune to the plague of ransomwares.[/quote:cmsotfn4]
MR Otto,
I don't want to waste time with you Mr Otto, tell me which object class you made yourself. the pickdate() class is irrelevant also because Linares made it for you, like pieces of your hotel program, as well as Nageswarao who has helped you many times to make your hotel program and don't tell me it's not true because I myself was present in the hotel when in the evening, away from your conference commitments, You went away to fix the pieces of software that weren't working.
You stuck your bootstraps with the easyreport software, you managed to convince Antonio Linares to buy a software that makes holes everywhere and doesn't work.
Now you are stuck with the html language involving the whole forum so much so that often we other users are forced to ask for help via email directly to Linares or directly to nages because in every topic we put on the forum you arrive with strange ideas of doing what not thing with the html language as if you've invented who knows what devilry but in essence it's always boiled hot water.
I do not share my professional and work experiences with those who have never shown me that they are capable of giving a technical speech, I am well aware of ransomware which is a malicious computer program that can infect a digital device (PC, tablet, smartphone, smart TV), blocking access to all or some of its contents (photos, videos, files, etc.) and then asking for a ransom (in English, “ransom”) to be paid to “free” them.
but the argument of Elvira was another, Elvira asked for a function or class to back up Blu-ray discs which I have to think you've never had, I have that type of 50GB CD memory and they cost a lot but it's a memory that doesn't use no one anymore because it's expensive, but apart from this you persistently continue with other topics that go beyond the topic's argument,
It's your national sport, but when I was doing the hotel program no one, not even me on the forum, hindered you when you asked for parts of programs or functions, now you do it often and I still can't understand your indomitable nature, because let's face it,
this story of the HTML language will also pass and then I'm curious to know what the next topic you will cling to is.
|
Backups into blu rays
|
[quote="Otto":17vb58yi]João, may I ask if you have personally seen a PC or server infected with ransomware?
Best regards,
Otto[/quote:17vb58yi]
Good morning Master Otto, YES I have seen it. This was a long time ago, today AVG antivirus can detect and prevent the attack. We solved it, precisely because we had BACKUP on PENDRIVE and in the CLOUD and on a SECOND HARD DISK.
Buenos días Maestro Otto, SÍ lo he visto. Esto fue hace mucho tiempo, hoy el antivirus AVG puede detectar y prevenir el ataque. Lo solucionamos, precisamente porque teniamos BACKUP en PENDRIVE y en la NUBE y en un SEGUNDO DISCO DURO.
Master Otto, a man forewarned is forearmed. An unprepared person is an S.F. ahahahahahaha
Maestro Otto, el hombre advertido está prevenido. Una persona que no está preparada es un S.F. ahahahahahaha
Regards, saludos.
|
Backups into blu rays
|
Silvio, at the moment I work on this:
<!-- m --><a class="postlink" href="https://mybergland.com/fwforum/tcweb.gif">https://mybergland.com/fwforum/tcweb.gif</a><!-- m -->
|
Backups into blu rays
|
[quote="karinha":24amc7hk][quote="Otto":24amc7hk]João, may I ask if you have personally seen a PC or server infected with ransomware?
Best regards,
Otto[/quote:24amc7hk]
Good morning Master Otto, YES I have seen it. This was a long time ago, today AVG antivirus can detect and prevent the attack. We solved it, precisely because we had BACKUP on PENDRIVE and in the CLOUD and on a SECOND HARD DISK.
Buenos días Maestro Otto, SÍ lo he visto. Esto fue hace mucho tiempo, hoy el antivirus AVG puede detectar y prevenir el ataque. Lo solucionamos, precisamente porque teniamos BACKUP en PENDRIVE y en la NUBE y en un SEGUNDO DISCO DURO.
Master Otto, a man forewarned is forearmed. An unprepared person is an S.F. ahahahahahaha
Maestro Otto, el hombre advertido está prevenido. Una persona que no está preparada es un S.F. ahahahahahaha
Regards, saludos.[/quote:24amc7hk]
I remind you that we are in 2024 and I could also make an international letter rogatory complete with a complaint against you because I can no longer tolerate your digs which are also in little taste and you don't even have the courage to write my full name and surname, you too you are a person whose entity I don't know, have you ever published an object class?
Joao,
do you still remember that the current topic posed by Elvira deals with backup on Blu-ray CDs, your comments (...S.F.) cannot be accepted, I invite you to respect the topics discussed and not feed any Trolls
|
Backups into blu rays
|
Silvio, I think what you want is a love letter. hahahahaha and not a letter rogatory. hahahahaha.
Silvio, creo que lo que quieres es una carta de amor. jajajajaja y ni una carta rogatoria. jajajajaja.
Regards, saludos.
|
Backups into blu rays
|
I think the path is Fivewin webapp.
I also dont understand Mr. Otto,s posts without source code.
|
Backups into blu rays
|
Elvira,
which posts are you referring to?
I can then gladly give you the source code.
Best regards,
Otto
|
Bad Email Dreams ...
|
For several years I have used SMTP so my clients can send emails. It works fine for me, and for many others, but on too many, it won't work. My guess is their service provider blocks the response, so the program never actually sends the email.
So, I decided to just insist they have an email client setup, and I would use MAPI.
If I use the code:
[b:we8bold5]ACTION winexec( "rundll32.exe url.dll, FileProtocolHandler mailto:support@masterlinksoftware.com")[/b:we8bold5]
It will work fine. The problem is that I want to send attachements and I don't believe this method allows for that possibility.
So I tried the FWH tMail option. I'm using Office Outlook 2010, so when I run it, I get a message that Outlook is not my default email service ( it is ), so it can't run the request.
I've tried all types of SMTP. It just isnt working in all cases. I can't solve the problem because of course it works fine on all my test machines.
Does anyone have suggestions ?
1) How to extend my working line of code to include attachements, or
2) How to get tMail to work with Outlook 2010 ( or is it a Win7 issue ? ).
Thanks
Tim
|
Bad Email Dreams ...
|
MAybe to try See32 library?
We are using this library for so many years and works perfect. We can send attachments.
The user must setup their mail server credentials (Smnp server, username, password, port) and this is it
|
Bad Email Dreams ...
|
Hi Tim,
May be CDOSys could handle it. It's included with every Win since 2000 Server, and works with ssl and attachments, and non convencional account like google or yahoo ones.
|
Bad Email Dreams ...
|
Thanks for the responses.
I'm still curious why the tMail option is not working with Office 2010 ( or is it a Windows 7 problem ? ).
Is there a fix ?
Tim
|
Bad Email Dreams ...
|
Tim
Cdossys is easy and works fine i can send atachments and html body, i tested with FWH for xHarbour and Harbour compiled with MVC, BCC and Mingw.
Regards,
|
Bad Email Dreams ...
|
Are there any samples of using cDosSys ? From what I see on the internet searches, it is designed for web based apps.
Tim
|
Bad Email Dreams ...
|
I have had really good luck with a SMTP Component from Ostrosoft. It is free for non-commercial license.
You only need to copy and register 1 dll file.
[url:17la1tx5]http://www.ostrosoft.com/OSSMTP6.asp[/url:17la1tx5]
If you are interested, let me know and I will send or post some sample code. It is really fast and reliable.
|
Bad Email Dreams ...
|
Tim,
This is my modified cdosys functions, you may to define a dbf to save config, for config use femail( cAlias ) parameter can be an alias or data object like dolphin query o tdabase object.
use config alias ... new ... shared ......
Femail( "config")
or
use config alias ...... new shared.
database oConfig
Femail( OConfig")
using tdolphin
oConfig := oServer:Query("Select * from config")
Femail( oConfig")
TO send mail use function Envia_Email( cFgAlias, cTo , cBcc, cSubJect, cAttach ) ..
[code=fw:1tvzjygf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#INCLUDE</span> <span style="color: #ff0000;">"FIVEWIN.CH"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"recursos.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"CdoSys.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span><br /><br />#ifndef _CDOSYS_CH<br /><span style="color: #00D7D7;">#define</span> _CDOSYS_CH<br /><span style="color: #00D7D7;">#define</span> cdoSMTPServer <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span><br /><span style="color: #00D7D7;">#define</span> cdoSMTPServerPort <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span><br /><span style="color: #00D7D7;">#define</span> cdoSendUsing <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span><br /><span style="color: #00D7D7;">#define</span> cdoSMTPPickupFolder <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"</span><br /><span style="color: #00D7D7;">#define</span> cdoSMTPAuthenticate <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span><br /><span style="color: #00D7D7;">#define</span> cdoSendUserName <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span><br /><span style="color: #00D7D7;">#define</span> cdoSendPassword <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span><br /><span style="color: #00D7D7;">#define</span> cdoSMTPUseSSL <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span><br /><span style="color: #00D7D7;">#define</span> cdoSMTPConnectionTimeout <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"</span><br />#endif<br /> <span style="color: #B900B9;">//20Us3rP4l3rm011</span><br /><span style="color: #00D7D7;">#define</span> NTRIM<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span> <span style="color: #000000;">(</span> LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00D7D7;">#define</span> WS_3DLOOK <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> CLR_HBROWN nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">205</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">176</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> CLR_NBLUE nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">142</span>, <span style="color: #000000;">171</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> str_replace<span style="color: #000000;">(</span>cString, cFind, cReplace <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> cStr,nPos,nTot,cToc1,cToc2<br /><br /> nPos := <span style="color: #00C800;">AT</span><span style="color: #000000;">(</span> upper<span style="color: #000000;">(</span>cFind<span style="color: #000000;">)</span>, upper<span style="color: #000000;">(</span>cString<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nTot := len<span style="color: #000000;">(</span> cFind <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> nPos > <span style="color: #000000;">0</span><br /><br /> cToc1 := <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> cString, <span style="color: #000000;">1</span>, nPos<span style="color: #000000;">-1</span> <span style="color: #000000;">)</span><br /> cToc2 := <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> cString, nPos + nTot + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /> cStr := cToc1+cReplace+cToc2<br /><br /> <span style="color: #00C800;">else</span><br /><br /> cStr := cString<br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">Return</span> cStr<br /><br /><span style="color: #B900B9;">//--------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> fEmail_config<span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg, aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">22</span> <span style="color: #000000;">]</span>, oFont,lOk:=.f.<br /><br /> <span style="color: #00C800;">Local</span> cMailServer := PadR<span style="color: #000000;">(</span> <span style="color: #ff0000;">"tuservidordecorreo.com"</span>, <span style="color: #000000;">60</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// servidor de correo</span><br /> cFrom := PadR<span style="color: #000000;">(</span> <span style="color: #ff0000;">"tucuenta@tuservidor.com"</span>, <span style="color: #000000;">60</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// remitente</span><br /> cTo := PadR<span style="color: #000000;">(</span> <span style="color: #ff0000;">""</span>, <span style="color: #000000;">180</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// destinatario (uno o varios separados con comas)</span><br /> cBCC := PadR<span style="color: #000000;">(</span> <span style="color: #ff0000;">""</span>, <span style="color: #000000;">180</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// copias ocultas a (uno o varios separados con comas)</span><br /> cAttach := PadR<span style="color: #000000;">(</span> <span style="color: #ff0000;">""</span>, <span style="color: #000000;">2048</span> <span style="color: #000000;">)</span>, ;<span style="color: #B900B9;">// archivo anexo (uno o varios separados con comas)</span><br /> cSubject := <span style="color: #ff0000;">"Informes Vencimiento Documentos "</span>+Dtoc<span style="color: #000000;">(</span>Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">" "</span>+time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// asunto</span><br /> cBody := <span style="color: #ff0000;">"Notificacion automatica de Vencimientos "</span>+CRLF+CRLF+<span style="color: #ff0000;">"Sistema de Control"</span>, ; <span style="color: #B900B9;">// cuerpo del mensaje</span><br /> nPort := <span style="color: #000000;">25</span> ,; <span style="color: #B900B9;">//465, ; // puerto usado por el servidor de correo // 465 si es Gmail</span><br /> cUser := Space<span style="color: #000000;">(</span> <span style="color: #000000;">60</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// nombre de usuario para autenticación </span><br /> cPass := Space<span style="color: #000000;">(</span> <span style="color: #000000;">30</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// contraseña para autenticación</span><br /><br /><span style="color: #00C800;">IF</span> valtype<span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>==<span style="color: #ff0000;">"C"</span><br /><br /> cMailServer := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSERVER<br /> cFrom := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CFROM<br /> cTo := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CTO<br /> cBCC := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CCC<br /> cSubJect := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSUBJECT<br /> nPort := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->NPORT<br /> cUser := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CUSER<br /> cPass := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CPASS<br /> cBody := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CBODY<br /><br /><span style="color: #00C800;">Else</span><br /><br /> cMailServer := cFgAlias:<span style="color: #000000;">CSERVER</span><br /> cFrom := cFgAlias:<span style="color: #000000;">CFROM</span><br /> cTo := cFgAlias:<span style="color: #000000;">CTO</span><br /> cBCC := cFgAlias:<span style="color: #000000;">CCC</span><br /> cSubJect := cFgAlias:<span style="color: #000000;">CSUBJECT</span><br /> nPort := cFgAlias:<span style="color: #000000;">NPORT</span><br /> cUser := cFgAlias:<span style="color: #000000;">CUSER</span><br /> cPass := cFgAlias:<span style="color: #000000;">CPASS</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /><br /><br /><span style="color: #B900B9;">// DEFINE FONT oFont NAME "Arial" SIZE 0, -16</span><br /><br /> oFont := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> GetDefaultFontName<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">0</span>, GetDefaultFontHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">455</span>, <span style="color: #000000;">703</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontb ;<br /> COLORS CLR_BLUE, CLR_HBROWN ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Configuracion Servidor de Envio de Informes para empresas"</span> ;<br /> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_3DLOOK <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Servidor de Correo:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cMailServer <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">206</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">294</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Puerto:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">320</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nPort <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K ####"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">24</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">24</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Remitente:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">24</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cFrom <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">264</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">39</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Destinatario:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">39</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cTo <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">264</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">54</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">9</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Copia para:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">54</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cBCC <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">264</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">69</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Adjuntar:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">69</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">12</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cAttach <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">253</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #B900B9;">// ACTION fAddAttach( aCtl[ 12 ] ) ; // descomentar para FWH 8.12 o posterior</span><br /><br /> @ <span style="color: #000000;">69</span>,<span style="color: #000000;">333</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"..."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> fAddAttach<span style="color: #000000;">(</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">12</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">84</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">13</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Asunto:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">84</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">14</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cSubject <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">264</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">99</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">15</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Autenticación: Usuario:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">99</span>, <span style="color: #000000;">87</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">16</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cUser <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">118</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">99</span>,<span style="color: #000000;">213</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">17</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Contraseña:"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_HBROWN <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">44</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">99</span>,<span style="color: #000000;">259</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">18</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cPass <span style="color: #0000ff;">OF</span> oDlg PASSWORD ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span>;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">85</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @<span style="color: #000000;">118</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">SAY</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">19</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Cuerpo del mensaje"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFont COLORS CLR_BLUE, CLR_HBROWN<br /><br /> @<span style="color: #000000;">126</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">20</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cBody <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont MULTILINE <span style="color: #0000ff;">UPDATE</span> ;<br /> COLORS CLR_BLUE, CLR_WHITE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">330</span>, <span style="color: #000000;">72</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @<span style="color: #000000;">208</span>,<span style="color: #000000;">213</span> <span style="color: #0000ff;">BUTTON</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">21</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Grabar"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">53</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lok:=.t.,oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @<span style="color: #000000;">208</span>,<span style="color: #000000;">292</span> <span style="color: #0000ff;">BUTTON</span> aCtl<span style="color: #000000;">[</span> <span style="color: #000000;">22</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Salir"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">53</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .T. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> lok == .t.<br /><br /> <span style="color: #00C800;">IF</span> valtype<span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /><br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> NET_READ<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSERVER := cMailServer<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CFROM := cFrom<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CTO := cTo<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CCC := cBCC<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSUBJECT := cSubJect<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->NPORT := nPort<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CUSER := cUser<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CPASS := cPass<br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CBODY := cBody<br /><br /> <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBRUNLOCK<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ELSE</span><br /><br /> cFgAlias:<span style="color: #000000;">CSERVER</span> := cMailServer<br /> cFgAlias:<span style="color: #000000;">CFROM</span> := cFrom<br /> cFgAlias:<span style="color: #000000;">CTO</span> := cTo<br /> cFgAlias:<span style="color: #000000;">CCC</span> := cBCC<br /> cFgAlias:<span style="color: #000000;">CSUBJECT</span>:= cSubJect<br /> cFgAlias:<span style="color: #000000;">NPORT</span> := nPort<br /> cFgAlias:<span style="color: #000000;">CUSER</span> := cUser<br /> cFgAlias:<span style="color: #000000;">CPASS</span> := cPass<br /> cFgAlias:<span style="color: #000000;">CBODY</span> := cBody<br /><br /> cFgAlias:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Endif</span><br /><br /> <span style="color: #00C800;">if</span> msgnoyes<span style="color: #000000;">(</span><span style="color: #ff0000;">"Desea Comprobar el envio ahora ?"</span><span style="color: #000000;">)</span><br /><br /> Envia_Email<span style="color: #000000;">(</span> cFgAlias, cTo , cBcc, cSubJect, cAttach <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//fSendMail( cMailServer, cFrom, cTo, cSubject, cBody, cAttach, cBCC, cUser, cPass, nPort )</span><br /><br /> <span style="color: #00C800;">Endif</span><br /><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//--------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> Envia_Email<span style="color: #000000;">(</span> cFgAlias, cTo1, cBcc1, cSubject1, cAttach1, cBody1,cDatos <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> cMailServer,;<br /> cFrom ,;<br /> cTo ,;<br /> cBCC ,;<br /> cSubJect ,;<br /> nPort ,;<br /> cUser ,;<br /> cPass ,;<br /> cBody<br /><br /> <span style="color: #00C800;">IF</span> valtype<span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /><br /> cMailServer := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSERVER<br /> cFrom := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CFROM<br /> cTo := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CTO<br /> cBCC := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CCC<br /> cSubJect := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CSUBJECT<br /> nPort := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->NPORT<br /> cUser := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CUSER<br /> cPass := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CPASS<br /> cBody := <span style="color: #000000;">(</span> cFgAlias <span style="color: #000000;">)</span>->CBODY<br /><br /> <span style="color: #00C800;">else</span><br /><br /> cMailServer := cFgAlias:<span style="color: #000000;">CSERVER</span><br /> cFrom := cFgAlias:<span style="color: #000000;">CFROM</span><br /> cTo := cFgAlias:<span style="color: #000000;">CTO</span><br /> cBCC := cFgAlias:<span style="color: #000000;">CCC</span><br /> cSubJect := cFgAlias:<span style="color: #000000;">CSUBJECT</span><br /> nPort := cFgAlias:<span style="color: #000000;">NPORT</span><br /> cUser := cFgAlias:<span style="color: #000000;">CUSER</span><br /> cPass := cFgAlias:<span style="color: #000000;">CPASS</span><br /> cBody := cFgAlias:<span style="color: #000000;">CBODY</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cTo1 := cTo<br /> <span style="color: #00C800;">DEFAULT</span> cSubject1 := cSubject<br /> <span style="color: #00C800;">DEFAULT</span> cBody1 := cBody<br /> <span style="color: #00C800;">DEFAULT</span> cAttach1 := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">DEFAULT</span> cBcc1 := cBcc<br /><br /> fSendMail<span style="color: #000000;">(</span> cMailServer, cFrom, cTo1, cSubject1, cBody1, cAttach1, cBCC1, cUser, cPass, nPort, cDatos <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> fSendMail<span style="color: #000000;">(</span> cMailServer, cFrom, cTo, cSubject, cBody, cAttach, cBCC, cUser, cPass, nPort, cDatos <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oCfg, oMsg, oError, nEle, cToken, ;<br /> aAttach := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>, ;<br /> lAuth := ! Empty<span style="color: #000000;">(</span> cUser <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> cPass <span style="color: #000000;">)</span>, ;<br /> nSendOpt := <span style="color: #000000;">2</span> <span style="color: #B900B9;">// send using: 1 = pickup folder 2 = port</span><br /><br /> <span style="color: #00C800;">Default</span> nPort := <span style="color: #000000;">25</span>, ;<br /> cSubject := <span style="color: #ff0000;">""</span>, ;<br /> cBody := <span style="color: #ff0000;">""</span>, ;<br /> cDatos := <span style="color: #ff0000;">"Sin datos que mostrar"</span>,;<br /> cBcc :=<span style="color: #ff0000;">""</span>,;<br /> cUser :=<span style="color: #ff0000;">""</span>,;<br /> cPass :=<span style="color: #ff0000;">""</span><br /><br /><br /> cBody := str_replace<span style="color: #000000;">(</span> cBody, <span style="color: #ff0000;">"<span style="color: #000000;">\D</span>ATOS<span style="color: #000000;">\"</span>, cDatos )<br /><br /> If "</span>GMAIL.COM<span style="color: #ff0000;">" $ Upper( cMailServer ) .and. ( Empty( cUser ) .or. Empty( cPass ) )<br /> MsgStop( "</span>Con GMail son requeridos nombre de usuario y contraseña<span style="color: #ff0000;">", "</span>Atención<span style="color: #ff0000;">" )<br /> Return Nil<br /> EndIf<br /><br /> CursorWait()<br /><br /> nEle := 1<br /><br /> While ! Empty( cToken := StrToken( cAttach, nEle++, "</span>,<span style="color: #ff0000;">" ) )<br /> AAdd( aAttach, cToken )<br /> EndDo<br /><br /> Try<br /> oCfg := CreateObject( "</span>CDO.Configuration<span style="color: #ff0000;">" )<br /><br /> With Object oCfg:Fields<br /> :Item( cdoSMTPServer ):Value := Trim( cMailServer )<br /> :Item( cdoSMTPServerPort ):Value := nPort<br /> :Item( cdoSendUsing ):Value := nSendOpt<br /><br /> If lAuth<br /> :Item( cdoSMTPAuthenticate ):Value := 1<br /> :Item( cdoSendUserName ):Value := Trim( cUser )<br /> :Item( cdoSendPassword ):Value := Trim( cPass )<br /> :Item( cdoSMTPUseSSL ):Value := 1<br /> EndIf<br /><br /> :Update()<br /><br /> End With<br /><br /> oMsg := CreateObject( "</span>CDO.<span style="color: #0000ff;">Message</span><span style="color: #ff0000;">" )<br /><br /> With Object oMsg<br /> :Configuration := oCfg<br /> :From := Trim( cFrom )<br /> :To := Trim( cTo )<br /> :Subject := Trim( cSubject )<br /> :TextBody := Trim( cBody )<br /> //:MDNRequested := .T. // confirmacion de recibido<br /> //:HTMLBody := strHTML<br /><br /> For nEle := 1 To Len( aAttach )<br /> :AddAttachment( AllTrim( aAttach[ nEle ] ) ) // := AllTrim( aAttach[ nEle ] )<br /> Next<br /><br /> If ! Empty( cBCC )<br /> :BCC := Trim( cBCC )<br /> EndIf<br /><br /> :Send()<br /> End With<br /><br /> Catch oError<br /><br /> CursorArrow()<br /><br /> cErrores:= "</span>No se pudo enviar el mensaje<span style="color: #ff0000;">" + CRLF + "</span>Error: <span style="color: #ff0000;">" + cValToChar( oError:GenCode) + CRLF + ;<br /> "</span>SubC: <span style="color: #ff0000;">" + cValToChar( oError:SubCode ) + CRLF + "</span>OSCode: <span style="color: #ff0000;">" + cValToChar( oError:OsCode ) + CRLF + ;<br /> "</span>SubSystem: <span style="color: #ff0000;">" + cValToChar( oError:SubSystem ) + CRLF + "</span>Mensaje: <span style="color: #ff0000;">" + oError:Description +"</span> <span style="color: #ff0000;">"+ if( ! Empty( oError:FileName ),;<br /> "</span>: <span style="color: #ff0000;">" + oError:FileName ,;<br /> if( !Empty( oError:Operation ),;<br /> "</span>: <span style="color: #ff0000;">" + oError:Operation ,;<br /> "</span><span style="color: #ff0000;">" ) )+CRLF<br /><br /> n := 2 // we don't disscard any info again !<br /><br /> while ( n < 74 )<br /> if ! Empty( ProcName( n ) )<br /> cErrores := CRLF+cErrores+"</span> Called <span style="color: #0000ff;">from</span>: <span style="color: #ff0000;">" + ProcFile( n ) + "</span> => <span style="color: #ff0000;">" + Trim( ProcName( n ) ) + ;<br /> "</span><span style="color: #000000;">(</span><span style="color: #ff0000;">" + NTRIM( ProcLine( n ) ) + "</span><span style="color: #000000;">)</span><span style="color: #ff0000;">"<br /><br /> endif<br /> n++<br /> end<br /><br /> ??? cErrores<br /><br /> oCfg := Nil<br /> oMsg := Nil<br /> Return Nil<br /><br /> End Try<br /><br /> oCfg := Nil<br /> oMsg := Nil<br /> SndPlaySound( GetWinDir() + "</span>\media\Tada.wav<span style="color: #ff0000;">", 0 )<br /> CursorArrow()<br /><br />Return Nil<br /><br />//---------------------------------------------------------------------------------------------//<br /><br />Static Function fAddAttach( oGet )<br /><br /> Local cFile, ;<br /> cAttach := oGet:VarGet()<br /><br /> cFile := cGetFile( "</span>*.*<span style="color: #ff0000;">", "</span>Selecciona el archivo<span style="color: #ff0000;">" )<br /><br /> If ! Empty( cFile )<br /> cAttach := Lower( PadR( AllTrim( cAttach ) + If( ! Empty( cAttach ), "</span>,<span style="color: #ff0000;">", "</span><span style="color: #ff0000;">" ) + AllTrim( cFile ), 2048 ) )<br /> EndIf<br /><br /> oGet:cText( cAttach )<br /><br />Return Nil<br /><br />//-----------------------------------------------------------------------------------------------//<br /><br /> <br /><br /></span></div>[/code:1tvzjygf]
|
Bad Email Dreams ...
|
If you are using Outlook 2007 or later then CDO does not get installed automatically. You have to install it as a stand alone product.
This page may help. [url:2zugnt68]http://j-integra.intrinsyc.com/support/kb/article.aspx?id=113792[/url:2zugnt68]
|
Bad Email Dreams ...
|
Nicanor,
I will try it but my concern is the SMTP protocal. It works fine for me here, but fails on some of my clients systems. That is the problem I am fighting.
Gale, its Free for NON-COMMERCIAL use but my application is being sold commercially.
Tim
|
Bad Email Dreams ...
|
Gale,
That download requires Outlook ( Office ) 2007 and will not work with 2010. It could be "tricked" but Microsoft does not recommend it.
Its interesting how MAILTO will trigger the MAPI Outlook client without a problem, but it, of course, doesn't support attachments.
I need a solution that works for all versions of Outlook, or another email client.
Tim
|
Bad Email Dreams ...
|
Tim i am using cdossys with an reserved account in my company server or an autenticated account with gmail an no problem.
Regards,
|
Bad Email Dreams ...
|
I think the problem is with our service providers. I believe they like to do data mining on all emails going through their system, so they block direct connections to other servers. Some providers have an alternative port that allows us to bypass it, but others I believe block the return even on the alternate port. Consequently we get no response from the server ( some locations ) and the email hangs up.
In other cases, I believe the malware software is not properly set, but I don't have control over this.
Thats why MAPI seems to be a better option, and also the emails are saved both ways, but newer versions of Office do not behave well with it.
Tim
|
Bad Email Dreams ...
|
If you are using Outlook 2010 you can use the Outlook object model directly . The only problem with that is the security pop-up. You can get a free utility (mapilabs) that can bypass the security pop-up, but the Outlook object model is much slower than other approaches.
Quick example without error checking.
[code=fw:2y5boo2m]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> olMailItem <span style="color: #000000;">0</span> <span style="color: #B900B9;">// Mail object</span><br /> oOutlook = CREATEOBJECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Outlook.Application"</span> <span style="color: #000000;">)</span><br /> oMail = oOutlook:<span style="color: #000000;">CreateItem</span><span style="color: #000000;">(</span> olMailItem <span style="color: #000000;">)</span><br /> oMail:<span style="color: #000000;">Recipients</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> <span style="color: #ff0000;"><!-- e --><a href="mailto:'test@mycompany.com">'test@mycompany.com</a><!-- e -->'</span> <span style="color: #000000;">)</span><br /> oMail:<span style="color: #000000;">Attachments</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\x</span>harbour<span style="color: #000000;">\t</span>est.htm"</span> <span style="color: #000000;">)</span><br /> oMail:<span style="color: #0000ff;">Subject</span> = <span style="color: #ff0000;">'Hello'</span><br /><br /> <span style="color: #B900B9;">// oMail:Body = "This is a test." // Text only body</span><br /> oMail:<span style="color: #000000;">HTMLBody</span> = MEMOREAD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\x</span>harbour<span style="color: #000000;">\t</span>est.htm"</span> <span style="color: #000000;">)</span><br /> oMail:<span style="color: #00C800;">Display</span> = .T.<br /> oMail:<span style="color: #000000;">send</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:2y5boo2m]
|
Bad Email Dreams ...
|
Gale your code generates:
Error description: Error Outlook.Application:CREATEITEM:ATTACHMENTS/87 E_INVALIDARG: ADD
|
Bad Email Dreams ...
|
Are you sure you used a valid file name?
If you are using xHarbour try this sample
[code=fw:ku0p5d5t]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> olMailItem <span style="color: #000000;">0</span> <span style="color: #B900B9;">// Mail object</span><br /><span style="color: #00D7D7;">#define</span> olByValue <span style="color: #000000;">1</span> <span style="color: #B900B9;">// attachment is a copy of the original file and can be accessed even if the original file is removed</span><br /><span style="color: #00C800;">function</span> main<br /> <span style="color: #00C800;">local</span> oOutlook, oMail<br /> <span style="color: #00C800;">local</span> cFilePath, cFileName<br /><br /> oOutlook = CREATEOBJECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Outlook.Application"</span> <span style="color: #000000;">)</span><br /> oMail = oOutlook:<span style="color: #000000;">CreateItem</span><span style="color: #000000;">(</span> olMailItem <span style="color: #000000;">)</span><br /> oMail:<span style="color: #000000;">Recipients</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> <span style="color: #ff0000;"><!-- e --><a href="mailto:'gale.ford@wwrowland.com.com">'gale.ford@wwrowland.com.com</a><!-- e -->'</span> <span style="color: #000000;">)</span><br /><br /> cFilePath := <span style="color: #ff0000;">"c:<span style="color: #000000;">\x</span>harbour<span style="color: #000000;">\"</span><br /> cFileName := "</span>xdiff.txt<span style="color: #ff0000;">"<br /> if file( cFilePath+cFileName )<br /> // oMail:Attachments:Add( cFilePath+cFileName, olByValue, 1, cFileName )<br /> oMail:Attachments:Add( cFilePath+cFileName )<br /> else<br /> ? 'File not found'<br /> endif<br /> oMail:Subject = 'Hello'<br /><br /> oMail:Body = "</span>This is a test.<span style="color: #ff0000;">" // Text only body<br /> oMail:Display = .T.<br /> // oMail:HTMLBody = MEMOREAD( "</span>c:\xharbour\test.htm<span style="color: #ff0000;">" )<br /> //oMail:Send()<br />return nil<br /></span></div>[/code:ku0p5d5t]
If you want to automatically send, I really do not like using this method. The new Outlook security is a pain. As long as you do not oMail:send() it can work ok.
|
Bad Email Dreams ...
|
Windows explorer is a nuisance when it doesn't show the extension.
I was attaching the error file which is text. Using error.txt fails, using error.log worked.
Thanks.
These are single emails with attachments. I'm going to create several options for them to use, including SMTP, Outlook, standard MAPI ( in case they have another email client ). Of course those who do strictly web based email clients don't understand why we can't email through them ( though their web client doesn't support the services ).
Tim
|
Bad Email Dreams ...
|
Tim,
For my [i:3hbxaic4]AktiveReport [/i:3hbxaic4]a reporting tool inside WINHOTEL which sends email reports to selected subscribers I made a workaround. I am sending the reports with FTP to my server and from there I send the emails.
It is too difficult to send automatically from clients PCs emails (Antivirus and other setup cases).
You could do the same with your error.log. You could send them through FTP to your server.
This is my configuration screen. You select the type of report and the recipients and when the report should be send.
[img:3hbxaic4]http://www.atzwanger-software.com//fw/aktivr1.jpg[/img:3hbxaic4]
Best regards,
Otto
|
Bad Email Dreams ...
|
[quote="TimStone":1swgc165]
These are single emails with attachments. I'm going to create several options for them to use, including SMTP, Outlook, standard MAPI ( in case they have another email client ). Of course those who do strictly web based email clients don't understand why we can't email through them ( though their web client doesn't support the services ).
Tim[/quote:1swgc165]
Tim:
I used to require a mapi program but this resulted in a lot of tech support and hassle, especially when Microsoft quit including Qutlook Express with Windows. Additionally, many users had problems using Outlook for security reasons. You can download and use Windows Live Mail with Vista and Win 7 but a lot of users were reluctant to download, install, and configure it for their email client and/or wanted us to do it for them. I no longer wanted to be dependent on someone else's email program. The other issue is the one you mentioned where a lot of users want to use web based email. If a user is using webbased email you can still send email using the smtp server of their internet provider.
For these reasons I went with smtp and so far it seems to be working fine. In addition to sending individual emails users can send batch emails (statments, invoices, notices, etc.) to numerous recipients at one time. I could never get the tsmtp class to work in all situations so I went with a 3rd party library. <!-- w --><a class="postlink" href="http://www.catalyst.com">www.catalyst.com</a><!-- w -->. Works with gmail, hotmail, and many other webbased email programs as well. We are only sending emails and not managing incoming email. We sometimes have minor tech support issues helping users specify the correct parameters for their smtp server. Users can check their email the same way they always have. The user can specify whatever From email they want so their recipients will reply to whatever email address they want them to regardless of the smtp server used to send email. Except with gmail, which requires the From be a gmail email address.
It's been my experience that you need to be able to configure certain parameters for certain smtp servers, i.e. some require authentication, some don't, some require SSL, some don't, etc.
Randal
|
Bad Email Dreams ...
|
Randal,
Thanks for the post. What Catalyst product are you using ? What compiler ? How did you elect to implement it ?
I do provide for various options ( authentication, alternate port, etc ), but most of my clients have no idea how to access their SMTP servers. In some cases, when it works, it does so for awhile, and then it doesn't.
Otto,
My clients usually don't automate emails ( although they can send service reminders automatically ). In most cases, they have a document ( which I convert to PDF and attach it to an email ) which they send to a client. When they send an email for tech support, it automatically picks up the error.log file from their computer which helps me a lot.
Tim
|
Bad Email Dreams ...
|
Tim,
>When they send an email for tech support, it automatically picks up the error.log file from their computer which helps me a lot.
I thought you can send this error.log with FTP to your server.
This way you can forget about sending email.
Best regards,
Otto
|
Bad Email Dreams ...
|
Otto,
Actually, I am trying to focus on them using email for tech support. When one of my clients calls me, they are often frustrated, and can't find the words to express themselves. Emails are more efficient. I respond to them in minutes. The error log makes it easy as an attachment.
Also, they don't have "servers" available to their clients, but they often have to send invoices as a PDF attachment to an email. These same people can't do searches to find attachments. No matter what training I provide, they still don't do it, get frustrated, and blame the software.
So, in my world ( client base ), I have to make it very simple.
Tim
|
Bad Email Dreams ...
|
[quote="TimStone":32jcqnts]Randal,
Thanks for the post. What Catalyst product are you using ? What compiler ? How did you elect to implement it ?
I do provide for various options ( authentication, alternate port, etc ), but most of my clients have no idea how to access their SMTP servers. In some cases, when it works, it does so for awhile, and then it doesn't.
[/quote:32jcqnts]
Tim:
I'm using the Socket Tools Library Edition with dll's and xHarbour. I defined all the functions I'm using with DLL FUNCTION. I think I posted these on this forum a while back.
I have one screen where the input their smtp server name, account name, password, port, with checkboxes for SSL and authenticate.
You'll see the library has all kinds of functions for internet, smtp, ftp, etc. I believe they have a 30 day demo.
If it works for while and then doesn't because there is a problem with their smtp server then it's not going to work with their email client (Outlook, Live Mail, etc) either.
Randal
|
Bad Email Dreams ...
|
[quote="TimStone":r7cgin5l]For several years I have used SMTP so my clients can send emails. It works fine for me, and for many others, but on too many, it won't work. My guess is their service provider blocks the response, so the program never actually sends the email.
[/quote:r7cgin5l]
Tim,
Do you have any kinds of logs from the smtp session with the clients that fail? One thing we have noticed is that if a mail comes from a dynamic ip address (ISP assigned), then a lot of servers will reject it because chances are good it might be spam. In that case people usually need to send via their ISP mail server and authenticate.
Alex
|
Bad Email Dreams ...
|
Alex,
Thanks for the comment. Mine is really a customer based issue rather than a FW problem. My clients really don't know ( understand ) their email service provider. Also, some of the ISP's contract off to other services, ie. Yahoo. Finally, many use webmail, and have no idea how to find the SMTP settings.
There are two areas of interest. First, for some, Outlook was working fine ( SMTP ), but the same settings with my program were not working. In other cases, when the settings in my program matched those in Outlook, it worked well. Secondly, my ISP provides a dynamic IP, but I have no problems. Also, I have tried hosting email accounts on my primary website. It works for me ( as does my ISP email ). However, for the clients who are having problems, it doesn't work for them.
The SMTP log usually indicates no connection / reply from the server ( when it fails ).
I did set it up with the CDO code provided earlier, and it is working from here ( but then I've never had a problem ). I'll see if that will work for my clients who are having problems.
Tim
|
Bad Email Dreams ...
|
Tim, only to mention it. You can install a Help Desk on your homepage, too.
Best regards,
Otto
|
Bad Email Dreams ...
|
Otto,
I actually did that, but this client base didn't use it. I also had a forum, but only the pornographers posted there.
I have a whole new set of websites going up in July and will have a new help desk and forum.
Tim
|
Bad Email Dreams ...
|
Using the CDOSYS method ( actually sent to me previously by Richard ), I had the following result:
Using xHarbour ( .com ) it builds and works correctly.
Using FWH 12.04, Harbour, and MSVC 2010, I get the following message displayed when I press the Send button:
Envoi Message Impossible
Errour 1
SubC 1006
OS Code 2147352573
Subsystem WINOLE
Message Argument error
Error messages are helpful WHEN we have a resource to understand them. Can anyone point me to a reference where I can decode this message and fix the problem ?
Tim
|
Bad Email Dreams ...
|
Tim,
Can you post code, to help you how can solve your error.
Regards,
|
Bad Email Dreams ...
|
Nincanor,
Thank you for the comment. I'm sorry for the long delay, but I had to replace my computer and it takes several days to get everything loaded and configured. He is the code that was used, resulting in the error. It works fine in xHarbour ( .com version ) but gives the error I mentioned earlier in Harbour ( with MSVC 2010 ).
Tim
[code=fw:id0e5d0v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> SMTPMAILS<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oCfg, oMsg, oError,cToken, ;<br /> nEle := <span style="color: #000000;">1</span>, ;<br /> dBcc := SPACE<span style="color: #000000;">(</span><span style="color: #000000;">1000</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/* Tabmail<br /><br />01 = MAILSERVER<br />02 = MAILFROM<br />03 = MAILTO<br />04 = SUBJECT<br />05 = BODY<br />06 = ATTACHMENT<br />07 = BCC<br />08 = LAUTHORIZATION<br />09 = USERID pour MAILSERVER<br />10 = PW pour MAILSERVER<br />11 = Mail port defaut = 25<br />12 = Mail HTML page<br />13 = ssl authentification<br />14 = Mail sender<br />15 = Organisation sender<br /><br />*/</span><br /><br /><span style="color: #00C800;">IF</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">// PORT</span><br /> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> := <span style="color: #000000;">25</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Try</span><br /> oCfg := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Configuration"</span> <span style="color: #000000;">)</span><br /><br /> With Object oCfg:<span style="color: #000000;">Fields</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">01</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// nPort</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">2</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">13</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// lauth</span><br /><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">10</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">13</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// cssl</span><br /> :<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> End With<br /><br /> SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oMsg := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Message"</span> <span style="color: #000000;">)</span><br /><br /> With Object oMsg<br /> :<span style="color: #000000;">Configuration</span> := oCfg<br /> :<span style="color: #0000ff;">From</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">02</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #0000ff;">To</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">03</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">ReplyTo</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">14</span><span style="color: #000000;">]</span><br /> :<span style="color: #0000ff;">Subject</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">04</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Sender</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">14</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// Read Receipt message is send to this</span><br /> :<span style="color: #000000;">Organization</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">15</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// "My Company Name"</span><br /><br /> :<span style="color: #000000;">TextBody</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">05</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">12</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">HTMLBody</span> := MEMOREAD<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">12</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">If</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">06</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">AddAttachment</span> := AllTrim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">06</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">If</span> LEN<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">FOR</span> nEle = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> LEN<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> nEle = <span style="color: #000000;">1</span><br /> Dbcc := ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> DBCC := ALLTRIM<span style="color: #000000;">(</span>DBCC<span style="color: #000000;">)</span> + <span style="color: #ff0000;">","</span> + ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>nEle<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">NEXT</span><br /> :<span style="color: #000000;">BCC</span> := Trim<span style="color: #000000;">(</span>DBCC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">EndIf</span><br /><br /> :<span style="color: #000000;">Send</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> End With<br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Catch oError<br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Envoi Message Impossible "</span> + CRLF + <span style="color: #ff0000;">"Erreur: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #ff0000;">"SubC: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">SubCode</span> <span style="color: #000000;">)</span> + CRLF + <span style="color: #ff0000;">"OSCode: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">OsCode</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #ff0000;">"SubSystem: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">SubSystem</span> <span style="color: #000000;">)</span> + CRLF + <span style="color: #ff0000;">"Message: "</span> + oError:<span style="color: #000000;">Description</span> <span style="color: #000000;">)</span><br /><br /> oCfg := <span style="color: #00C800;">Nil</span><br /> oMsg := <span style="color: #00C800;">Nil</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br />End <span style="color: #00C800;">Try</span><br />oCfg := <span style="color: #00C800;">Nil</span><br />oMsg := <span style="color: #00C800;">Nil</span><br />SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /><br /> </div>[/code:id0e5d0v]
|
Bad Email Dreams ...
|
TIm,
Change this line:
If LEN(ALLTRIM(TABMAIL[06])) > 0
:AddAttachment := AllTrim( TABMAIL[06] )
ENDIF
for
If LEN(ALLTRIM(TABMAIL[06])) > 0
:AddAttachment( AllTrim( TABMAIL[06] ) )
ENDIF
Same code works in harbour and xharbour
Regards,
|
Bad Email Dreams ...
|
After making the change, I get error 1, SubC: 1068, OSCode 0 SubSystem BASE Message Argument error
|
Bad Email Dreams ...
|
Tim
Which info do you have in TABMAIL[06] ? if file found ?
Regards,
|
Bad Email Dreams ...
|
06 refers to the attachements. I tried two tests. The first was to send the name of an existing file in the directory, and it is there. The second was to send a "" value for the file name. Thus The LEN should evaluate to 0 and :AddAttachment should not be called. In both cases I do a messageinfo( ) to display the content and it is correct.
I am sending this as a string. With SMTP we have to pass an array of string values,
Also, this is using Harbour. With xHarbour, the implementation works fine as is. However, I'm trying to complete a move to Harbour and MSVC.
Tim
|
Bad Email Dreams ...
|
Tim,
have you tried FWH\samples\TestMail.prg ? Here it works very fine...
|
Bad Email Dreams ...
|
Antonio,
As noted earlier in this thread, I previously used FWH SMTP. I had no problems with it, and it still works for me. However we have major issues with ISPs, and so it doesn't work for some of my clients. It does not get a response from the email server. Being able to email documents is very important in my application, so I must have the ability to do attachments.
I can't resolve problems because on my own system there has never been a problem. On the ones where people do have problems, its with our SMTP, but their Outlook, for example, may work just fine with the same settings.
Thats why it gives me "bad dreams"
Tim
|
Bad Email Dreams ...
|
Tim i'm using MSVC and no problem, i'm going to compile your code later to find error. do you have an example calling this function ?
Regards
Nicanor
|
Bad Email Dreams ...
|
Tim,
With xHarbour and Harbour i get errors, i know where is your problem, you are using same parameter for Autentication and SSL, should be logical .T. or .F. i dont know wich type are you using when call function.
[code=fw:2go4zz5l]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> With Object oCfg:<span style="color: #000000;">Fields</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">01</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// nPort</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">2</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> :=<span style="color: #000000;">[</span><span style="color: #0000ff;">color</span>=#FF0000<span style="color: #000000;">]</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">13</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>/<span style="color: #0000ff;">color</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// lauth</span><br /><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">10</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">[</span><span style="color: #0000ff;">color</span>=#FF0000<span style="color: #000000;">]</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">13</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// cssl</span><br /> :<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> End With<br /> </div>[/code:2go4zz5l]
And this is modified code tested with Gmail.
[code=fw:2go4zz5l]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">//-----------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SMTPMAILS<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oCfg, oMsg, oError,cToken, ;<br /> nEle := <span style="color: #000000;">1</span>, ;<br /> dBcc := SPACE<span style="color: #000000;">(</span><span style="color: #000000;">1000</span><span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">DEFAULT</span> Tabmail := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"smtp.gmail.com"</span> ,;<br /> <span style="color: #ff0000;">"youremail@gmail.com"</span>,;<br /> <span style="color: #ff0000;">"your_friend@anyserver.com"</span>,;<br /> <span style="color: #ff0000;">"Test from Tim Function "</span>,;<br /> <span style="color: #ff0000;">"This is a test no answer"</span>,;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\j</span>mbbackup<span style="color: #000000;">\b</span>arranquilla.pdf"</span>,;<br /> <span style="color: #ff0000;">""</span>,;<br /> .t.,;<br /> <span style="color: #ff0000;">"youremaail@gmail.com"</span>,;<br /> <span style="color: #ff0000;">"YourPassWord"</span>,;<br /> <span style="color: #000000;">465</span>,;<br /> <span style="color: #ff0000;">""</span>,;<br /> .t.,;<br /> <span style="color: #ff0000;">""</span>,;<br /> <span style="color: #ff0000;">""</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #B900B9;">/* Tabmail<br /><br />01 = MAILSERVER<br />02 = MAILFROM<br />03 = MAILTO<br />04 = SUBJECT<br />05 = BODY<br />06 = ATTACHMENT<br />07 = BCC<br />08 = LAUTHORIZATION<br />09 = USERID pour MAILSERVER<br />10 = PW pour MAILSERVER<br />11 = Mail port defaut = 25<br />12 = Mail HTML page<br />13 = ssl authentification<br />14 = Mail sender<br />15 = Organisation sender<br /><br />*/</span><br /><br /><span style="color: #00C800;">IF</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">// PORT</span><br /> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> := <span style="color: #000000;">25</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Try</span><br /> oCfg := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Configuration"</span> <span style="color: #000000;">)</span><br /><br /> With Object oCfg:<span style="color: #000000;">Fields</span><br /><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">01</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">11</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// nPort</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">2</span> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">08</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// lauth</span><br /><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">09</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">10</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> :<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">13</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// cssl</span><br /><br /> :<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> End With<br /><br /> SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oMsg := CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Message"</span> <span style="color: #000000;">)</span><br /><br /> With Object oMsg<br /> <br /> :<span style="color: #000000;">Configuration</span> := oCfg<br /> :<span style="color: #0000ff;">From</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">02</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #0000ff;">To</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">03</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">ReplyTo</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">14</span><span style="color: #000000;">]</span><br /> :<span style="color: #0000ff;">Subject</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">04</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Sender</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">14</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// Read Receipt message is send to this</span><br /> :<span style="color: #000000;">Organization</span> := TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">15</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// "My Company Name"</span><br /><br /> :<span style="color: #000000;">TextBody</span> := Trim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">05</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">12</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">HTMLBody</span> := MEMOREAD<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">12</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">If</span> LEN<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">06</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">AddAttachment</span><span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">06</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// := AllTrim( TABMAIL[06] )</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">If</span> LEN<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">FOR</span> nEle = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> LEN<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> nEle = <span style="color: #000000;">1</span><br /> Dbcc := ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> DBCC := ALLTRIM<span style="color: #000000;">(</span>DBCC<span style="color: #000000;">)</span> + <span style="color: #ff0000;">","</span> + ALLTRIM<span style="color: #000000;">(</span>TABMAIL<span style="color: #000000;">[</span><span style="color: #000000;">07</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>nEle<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">NEXT</span><br /> :<span style="color: #000000;">BCC</span> := Trim<span style="color: #000000;">(</span>DBCC <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">EndIf</span><br /><br /> :<span style="color: #000000;">Send</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> End With<br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Catch oError<br /> cErrores:= <span style="color: #ff0000;">"No se pudo enviar el mensaje"</span> + CRLF + <span style="color: #ff0000;">"Error: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">GenCode</span><span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #ff0000;">"SubC: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">SubCode</span> <span style="color: #000000;">)</span> + CRLF + <span style="color: #ff0000;">"OSCode: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">OsCode</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #ff0000;">"SubSystem: "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">SubSystem</span> <span style="color: #000000;">)</span> + CRLF + <span style="color: #ff0000;">"Mensaje: "</span> + oError:<span style="color: #000000;">Description</span> +<span style="color: #ff0000;">" "</span>+ <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ! Empty<span style="color: #000000;">(</span> oError:<span style="color: #000000;">FileName</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #ff0000;">": "</span> + oError:<span style="color: #000000;">FileName</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !Empty<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Operation</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #ff0000;">": "</span> + oError:<span style="color: #000000;">Operation</span> ,;<br /> <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>+CRLF<br /><br /> n := <span style="color: #000000;">2</span> <span style="color: #B900B9;">// we don't disscard any info again !</span><br /><br /> <span style="color: #00C800;">while</span> <span style="color: #000000;">(</span> n < <span style="color: #000000;">74</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ProcName<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cErrores := CRLF+cErrores+<span style="color: #ff0000;">" Called from: "</span> + ProcFile<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" => "</span> + Trim<span style="color: #000000;">(</span> ProcName<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">"("</span> + NTRIM<span style="color: #000000;">(</span> ProcLine<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">")"</span><br /><br /> <span style="color: #00C800;">endif</span><br /> n++<br /> end<br /> <br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> cErrores <span style="color: #000000;">)</span><br /> <br /> oCfg := <span style="color: #00C800;">Nil</span><br /> oMsg := <span style="color: #00C800;">Nil</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br />End <span style="color: #00C800;">Try</span><br /><br /><br />oCfg := <span style="color: #00C800;">Nil</span><br />oMsg := <span style="color: #00C800;">Nil</span><br />SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /><br /> </div>[/code:2go4zz5l]
Regards,
|
Bad Email Dreams ...
|
I made the changes but can't get a build right now. I'm running into a different problem.
TIm
|
Bad Email Dreams ...
|
Tim
Did you solve your SMTP e-mail problems .. I was thinking about using CDO, but from the research I have been doing, CDO is not a component loaded on every Windows OS ??
Correct me if I am wrong ?
Thanks
Rick Lipkin
|
Bad Email Dreams ...
|
I did use the CDO solution and it works here.
Of course the SMTP solution also worked here.
I'm on Win 7 and it has not difficulty in the default install / setup.
|
Bad Email Dreams ...
|
I confirm CDO works also in Window 8 beta and last preview Release, tested and working fine.
Regards,
|
Bad Email Dreams ...
|
hi TimStone :
The 32bit .exe for borland Compiler,
I test a CDO with Attach files solution for WIN7(64bit/32bit).
1) don't double click the .exe file.
2) don't Put .exe file in Current Directory , put it in difference Directory Path
3) Write A batch file and Launch the Batch file(or link file)
---------
#Dump call_exe.bat(in Current Directory)
start .\exe_file\TESTMAIL.EXE
#END DUMP
-----------
I test it work Fine for :
Win7(32bit)+ office 2003+cdo
Win7(32bit)+ office 2007
Win7(32bit)+ office 2010(32bit)
Win7(64bit)+ office 2007(32bit)
Win7(64bit)+ office 2010(32bit)
Win7(64bit)+ office 2010(64bit)
In Win8 you can double click the .exe file and work Fine.
I didn't try FWH64.
--
Best Regards
--------------------------------------------------------------
kokoo KAO
|
Bad Email Dreams ...
|
Randal,
I downloaded today the Catalyst trial version. I saw your DLL listing elsewhere.
Could you provide us with a sample of how you implemented this DLL ? Also you reference the LIB calls. Did you link in the LIB's that are included into your build ? I've got a build with xHarbour that uses Peles C, and one with MSVC 2010 which I know is supposed to be compatible with Catalyst.
In your notes you indicate you set this up for SSL. Their samples are a bit limited for what I'm trying to discover.
Your guidance would be greatly appreciated. Sadly many of the servers today want SSL and our TSMTP protocol in FWH does not support it.
Tim
|
Bad Email Dreams ...
|
Tim,
After reading this thread, it sounds like most of the problems you are having are related to the SMTP setup--not the software's capabilities (with the exception of the SSL issue).
Can you give us some examples of SMTP servers that users are having problems with? I mean just the names of the servers like AOL, Hotmail, Cox, etc.
Note that only premium Yahoo accounts (paid) have SMTP access--free accounts don't. At least this was true the last time I checked which was a couple of years ago.
Near as I can tell, gmail accounts require SSL, but I have seen a reference to turning off this requirement. Turning it off would be an option although a much better option would be to have SSL capabilities in our FW TMail class.
Attachments ALWAYS have to include the COMPLETE PATH including the drive.
When you say everything always works for you, do you mean you are actually able to send to your client's SMTP server but they are not? Have you confirmed you are both using the same parameters? I know this can be touchy since you will need their password to test the system, but they could always change it while you test, then restore the original one.
You program could be getting blocked by their firewall.
You can find a lot of SMTP server's setup parameters on the net such as:
[url:3owqsenv]http://www.c3sd.com/email_servers_ports.php[/url:3owqsenv]
[url:3owqsenv]http://www.emailaddressmanager.com/tips/mail-settings.html[/url:3owqsenv]
You might consider including a list of common email servers for users to select from. Behind the scenes you would already have the setup parameters for each server in a file. Thus all the user does is select a server and add their username and password. This would prevent a lot of confusion.
Regards,
James
|
Bad Email Dreams ...
|
James,
First, its great to see a post from you. It has been a long time. I tried emailing directly a couple of times ...
To answer your question, I have Cox Internet here. I have no problem with any email, either SMTP, or CDO. I also can use my own MasterLink host, and post through that server without a problem. Thus, I cannot make any of the email methods fail.
I setup a SMTP server on one of my hosted systems, and it works fine with the alternate port.
Apparently some ISPs are doing a lot of blocking, and they are pretty much pushing web mail ! Quest in AZ is one of the more problematic. The request goes to the server, but we never receive back the response. This becomes very frustrating for my clients.
Apparently the problem exists with SSL requirements ( and TSL ). I have looked at 3rd party packages to see if this can be added. As was also pointed out here, more and more servers are requiring SSL and it is not supported with our current software.
Five Win has done a lot, but I think the one significant weakness is in the area of communications. XML has been there for years, but the implementation of it in this program is hit and miss ( minimal ). SQL essentially requires 3rd party drivers, yet it is the standard database today. The internet, asynchronous communications, and data sharing are all the primary focus of today's apps, yet we don't do much there.
To be competitive in 2013, all of these capabilities will need to be met in the development tools.
Tim
|
Bad Email Dreams ...
|
Tim,
While I don't disagree with you about the need for better communications capabilities within FW/Harbour, I am not sure that those are your current problems.
So far you have only told me that you are able to use SMTP on your servers--you have not said that you have tested any of the client's problem servers.
I note that Quest is a dial up service which can present other problems such as are they connected, etc. Also there is no mention of SSL at all in their setup instructions:
<!-- m --><a class="postlink" href="http://www.qwest.net/help/email.html">http://www.qwest.net/help/email.html</a><!-- m -->
So, I don't think SSL is the problem with them.
Regards,
James
|
Bad Email Dreams ...
|
James,
Sorry, this has gone on for a long time.
No, none of these are dial up. They are all ISP's and some of them have farmed the email service to other companies, ie. Yahoo. The service is either DSL or Cable.
The sequence is quite simple. The process always dies on the response. This means that the SMTP in FWH makes a call for a connection, and apparently submits the email, but never gets a confirmation. This is where the process dies.
The full code is here in other emails. Also, other people have noted similar problems, and they have gone to 3rd party communications packages to get past it.
Most newer services require SSL or TSL. Thus, without that, we can't communicate. For example, I could probably get all of my clients to sign up for a Microsoft Office 365 account ... the benefits are amazing, and Exchange Email can be had for $4 / month. Any business can afford that. However, it also requires TSL for an SMTP connection.
I think you will find most providers do require that now. Its been provided for years.
Tim
|
Bad Email Dreams ...
|
Tim/James;
Hi.
There is an easy way to reproduce the problem Tim has been trying to explain all along on this thread. Create a gmail account. Configure the newly created email account on your email client on your pc. Note that you will have a choice of ports to use. You will be able to send and receive emails using the gmail account with your choice of e-mail client (I use iMac's Mail 4.6 -works great).
Now try to use the very same gmail mail server to deliver emails from a fwh application and you will soon learn that it becomes impossible unless you can communicate over a secure socket connection using ssl authentication. Anyone who can figure out how to send emails using a Gmail from a fwh application should be able to solve the problem that Tim has been trying to call the attention to.
There are still hosting companies providing their own smtp server with user-name + password authentication, but I'm afraid they are soon becoming extinct. It used to be that ISPs blocked port 25 to avoid spamming over their SMTP servers. Eventually every mail service will be over ssl. It is a matter of time.
Reinaldo.
|
Bad Email Dreams ...
|
Reinaldo & Tim,
Oh, I am quite aware of the SSL issue. However, it was unclear to me from reading this thread that any of the problems Tim was having had anything to do with SSL. From my experience most problems are because clients don't know how to setup the SMTP server ports, etc. so I was just trying to point this out.
Yes, we badly need SSL capability. There has been some discussions about this in the Spanish FW/Harbour forum some time back. There is a email class that supposedly has SSL capability, however, it requires OpenSSL to be installed on every computer that will be sending mail. This is not a feasible solution.
All the commercial libraries I have seen are about US$300 and up. This is kind of steep, however this may be the only solution.
Regards,
James
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.