2012-02-06

FoxyPreviewer email configurations

FoxyPreviewer brings 4 ways for you to send emails:

1 – MAPI - Uses the WinAPI MapiSendMail to try to send the current report as an attachment.
This setting sends a standard message, with one or more attached files and a cover note. The cover note is a dialog box that allows the user to enter a list of recipients and an optional message and other sending options. It will open a dialog email sending message, waiting for a user interaction. The message will not be sent automatically. It’s up to the user to veryfy the information ofthe message and to click at the “Send” button. 
This function tries to establish a session using the messaging system's shared session. If no shared session exists, it will fail sending the message.
This works pretty well if you have your default account set using MS Outlook Express, MS Outlook or Windows Live Mail. Definitely, it’s the easiest way to send your messages, because this way, FoxyPreviewer will use the default Email configuration of the computer.

2 - MAPI Alternative – Uses the WinAPI MapiSendDocuments to try to send the current report as an attachment.
The MAPISendDocuments function sends a standard message with one or more attached files and a cover note. The cover note is a dialog box that allows the user to enter a list of recipients and an optional message and other sending options.
This function tries to establish a session using the messaging system's shared session. If no shared session exists, it will fail sending the message.
This works pretty well if you have your default account set using MS Outlook Express, MS Outlook or Windows Live Mail. Definitely, it’s the easiest way to send your messages, because this way, FoxyPreviewer will use the default Email configuration of the computer.
Although MS says that “The use of this function is discouraged. It may be altered or unavailable in subsequent versions of Windows.”, it’s been working well in all OS’s, from WinNT to WinSeven

3 – Custom Procedure
You can use your own procedure to send the current report. use foxypreviewer property "cEmailPrg", and fill it with the name of the prg responsible for sending emails. This PRG receives as a parameter the file name of the file created that you will send as attachment. Have a look at the samples provided, the file mysendmail.prg shows how you would need to make your custom procedure.

4 – CDO
Uses the CDO2000 component included in windows 2000 and later. It allows you to send emails using a SMTP server. All settings must be accurate in order to make this work. For example, below is the configuration for a “Hotmail” or “Live” account to send emails. You may check also in Sergey Berezniker's blog for more information on how to send using MSN, YAHOO or GMAIL email messages using CDO: http://www.berezniker.com/category/topic/email


People always send messages in forums asking how they should make these configurations. In fact, they change from server to server, the best you can do is to check the Email server that you are using, and get the right configurations for SMTP Server, SMTP Port and SSL Connection.
Thanks to MK Sharma, from Foxite, I found this link, that brings some SMTP general information about several servers: http://mynokiamobile.blogspot.in/2008/01/smtp-pop3port-settings-for.html
And here is a list of servers with some common configurations for people who use Brazilian servers:
http://superlogica.com/faq/00259

Please note that I did not test any of the settings below, please make your tests!

Server SMTP adress Port(s) Use SSL
HOTMAIL / LIVE
smtp.live.com
25
TRUE
YAHOO
smtp.mail.yahoo.com
25 or 465
TRUE
GOOGLE
smtp.gmail.com
465 or 25
TRUE
AOL
smtp.aol.com
NETSCAPE
smtp.isp.netscape.com
25
MSN
smtp.email.msn.com
REDIFF
smtp.rediffmailpro.com
UOL
smtp.uol.com.br
25
TRUE
UOL smtps.uol.com.br 587 or 465 TRUE

5 comments:

  1. Consider the option of selecting Attachment file type on sending mail windows.

    ReplyDelete
  2. problem in send email file

    ReplyDelete
  3. I am trying to pass some parameters to the FoxyPreviewer object.
    I am using outlook 2010 as the default email pgm.
    From my DB in Foxpro 9, I would like to pass the TO: field with the person's email.
    It would also be very good to include Bcc and CC but not necessary.
    I used this: .cSaveDefName="MPTESTPDF" && this works!! to pass a file save name (becomes subject also)
    I am unsure of the correct parameters to pass, so I looked around and found reference to MYSENDMAIL.PRG
    I don't know if this would work (MAPI Alternative - using this method) but I wanted to try it.
    Unfortunately, the MYSENDMAIL. prg is not in the source code (at least not as a prg) and I could not find it on the site.
    This is a very useful chunk of code. Writing report listeners is time consuming and I am trying to avoid having to do that coding as much as possible.
    If someone would let me know if I could use MYSENDMAIL.PRG as a template as I outlined and if so, where can I find it.
    thanks for the help (and the utility)
    Regards,
    Mark Anthony

    ReplyDelete
  4. i get this Error

    #1429 -send - 0x0000020D CDO.Message.1 At least one of the from or Sender fields is required and neither was found

    Message was not sent

    ReplyDelete
  5. #1429 -send - 0x0000020D CDO.Message.1 At least one of the from or Sender fields is required and neither was found

    Message was not sent

    ReplyDelete