FoxPro Programming
Email Attachments
Gravatar is a globally recognized avatar based on your email address. Email Attachments
  Lonnie Hardesty
  All
  Apr 30, 2022 @ 01:47pm

Attempting to attach 2 files, a .dbf and .fpt, to an email being sent to a supplier. Using 7.27 emailsend.prg, I think you wrote this for me, and probably others as well. I tried the versions before 1st Version I got, then 7.15, 7.23 and now using 7.27. I'm pretty sure someplace alone the way this feature worked by storing the path and file name of the files to be attached, separated by a comma, into a mem var, mcAttachment, and then in an IF statement ...

mcAttachment = "c:\temp\somefile.DBF,c:\temp\somefile.FPT"
IF !EMPTY(mcAttachment)
    o.AddAttachment = mcAttachment
 ENDIF

Got Error 1737, AddAttachment is a method, event or object.

ALSO TRIED ...

o.AddAttachment("&mcAttachment") and
=o.AddAttachment("&mcAttachment")

Got error 1429 OLE ERROR with both of these.

I tried all the versions listed above with each of these attempts with no luck.

Help!!

Lonnie

Gravatar is a globally recognized avatar based on your email address. re: Email Attachments
  Rick Strahl
  Lonnie Hardesty
  Apr 30, 2022 @ 11:13pm

Sounds like you have an old version of wwDotnetBridge.dll - make sure that if you updated to Client Tools 7.27 that you update all the DLLs as well as your code.

You can check the version number of the DLLs in the file properties in Explorer.

Careful with Binary Attachments

I would not recommend attaching DBF/FTP files directly to an email, as they will likely be rejected by mail clients. GMail for example will not let you receive files like this - Gmail rejects files when receiving the email and removes the attachment (often without letting you know that it did so!). You can try zipping the files into a Zip archive which may work better, but even that often isn't enough as major mail providers scan zip archives and check for binary or executable files.

It's not just binary files either - it's even source code files like .prg or .cs files will get rejected even in zip files.

For data transfers these days the only good reliably solution is to drop the file in a shared location or serve it dynamically to be retrieved directly by the application.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Email Attachments
  Lonnie Hardesty
  Lonnie Hardesty
  May 2, 2022 @ 09:38pm

Thanks guys ... I got it to work!!

© 1996-2024