* Preparacion lcWWPath = 'z:\wc\wconnect\classes\' Thisform.oIPStuff = NEWOBJECT('wwIPStuff',ADDBS(lcWWPath)+'wwIPStuff') *#define HKEY_CURRENT_USER (2^31) + 1 lcDefaultMail = SPACE(50) lcMailServer = SPACE(50) lcSenderEmail = SPACE(50) * Aqui obtenemos del registry info sobre el correo default. * El IF .T. utiliza Codemine y funciona. * Si no tienes Codemine, el ELSE no funciona bien todavia, pero lo puedes depurar y solo utiliza una clase que viene con VFP. IF .T. cmRegGetValue(HKEY_CURRENT_USER,'Software\Microsoft\Internet Account Manager\Default Mail Account',@lcDefaultMail) cmRegGetValue(HKEY_CURRENT_USER,'Software\Microsoft\Internet Account Manager\Accounts\'+lcDefaultMail+'\SMTP Server',@lcMailServer) cmRegGetValue(HKEY_CURRENT_USER,'Software\Microsoft\Internet Account Manager\Accounts\'+lcDefaultMail+'\SMTP Email Address',@lcSenderEmail) ELSE * Use try/catch in case key does not exist Thisform.oRegistry.nCurrentKey = HKEY_CURRENT_USER TRY Thisform.oRegistry.GetKeyValue('Software\Microsoft\Internet Account Manager\Default Mail Account',@lcDefaultMail) CATCH ENDTRY TRY Thisform.oRegistry.GetKeyValue( ; 'Software\Microsoft\Internet Account Manager\Accounts\'+lcDefaultMail+'\SMTP Server',@lcMailServer) CATCH ENDTRY TRY Thisform.oRegistry.GetKeyValue( ; 'Software\Microsoft\Internet Account Manager\Accounts\'+lcDefaultMail+'\SMTP Email Address',@lcSenderEmail) CATCH ENDTRY Thisform.oIPStuff.cMailServer = lcMailServer Thisform.oIPStuff.cSenderEmail = lcSenderEmail ENDIF * Validacion IF EMPTY(This.Parent.txtRecipient.Value) WAIT WINDOWS 'El destinatario no puede estar vacio' TIMEOUT 2 This.Parent.txtRecipient.SetFocus RETURN 0 ENDIF * Create file name lcJustExt = UPPER(JUSTEXT(This.Parent.txtAttachment.value)) lcJustStem = UPPER(JUSTSTEM(This.Parent.txtAttachment.value)) lcJustPath = UPPER(JUSTPATH(This.Parent.txtAttachment.value)) * Create text file lcFile = ADDBS(lcJustPath) + lcJustStem + '.' + 'TXT' Thisform.ReportToAsciiFile(Thisform.RptTmpFile,lcFile) Thisform.oIPStuff.cRecipient = This.Parent.txtRecipient.Value Thisform.oIPStuff.cCCList = This.Parent.txtCCList.Value Thisform.oIPStuff.cRecipient = This.Parent.txtRecipient.Value Thisform.oIPStuff.cSubject = This.Parent.txtSubject.Value Thisform.oIPStuff.cAttachment = lcFile Thisform.oIPStuff.cMessage = This.Parent.edtMessage.Value Thisform.oIPStuff.SendMail() Thisform.Release()Ojala te ayude.