> Refer to the Simon Arnold's article
http://weblogs.foxite.com/simonarnold/articles/320.aspx.
>
> I tried running the code of the first block very basic sendin of an email. But VFP is rejecting saying a compile error "command contains unrecognized phrase or key word" at the point in the code where it is shown in bold letters.
>
> could someone please help me in resolving this?
>
> Regards,
>
> Srikant
>
>
> The code which I am running is also pasted here for your immediate reference.
>
> LOCAL loOutlook AS Outlook.Application
>
> LOCAL loNameSpace AS Outlook.NameSpace
>
> LOCAL loMailItem AS Outlook.MailItem
>
> LOCAL llShowItem AS Boolean
>
>
>
> #DEFINE olMailItem 0
>
>
>
> loOutlook = CREATEOBJECT('Outlook.Application')
>
> loNameSpace = loOutlook.GetNamespace("MAPI")
>
> loNameSpace.Logon
>
> loMailItem = loOutlook.CreateItem( olMailItem ) && This creates the MailItem Object
>
> llShowItem = .T.
>
>
>
> WITH loMailItem
>
>
.Subject = “Test Email with VFP Automation”>
> .Recipients.Add(“
fred.bloggs@bloggsville.com”)
>
> .Body = “This is the Main Text of the email“
>
>
>
> IF llShowItem
>
> .Display && Shows the New Message Dialog with all details from
>
> && above filled in.
>
> ELSE
>
> .Send && Calling this will cause a Security Dialog
>
> ENDIF
>
>
>
> ENDWITH
Check the quote sign that is not chr(34) or " its chr(148) or ”.
so just change all the quote sign in ur prg :)
Anil
My Blog