Normal Topic Attach a document to auto email. (Read 14040 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Attach a document to auto email.
Apr 10th, 2020 at 6:35pm
Print Post Print Post  
I have programming in my application to automatically email info to several users depending on an event occurrence.

I was wondering if it is possible to automatically include a .pdf or Word document with the email.  I will need the programming to select the document from a known directory.

Can this be done?

Thanks for any help!
  
Back to top
 
IP Logged
 
Renato Piacenti
Member
*
Offline


No personal text

Posts: 48
Location: Manaus - Amazonas - Brazil
Joined: Jun 20th, 2005
Re: Attach a document to auto email.
Reply #1 - Apr 10th, 2020 at 7:51pm
Print Post Print Post  
     I hope it helps you.
     If you need complete programming send an email to
     piacenti123@yahoo.com.br
            
     Create the Email Address field and a File Field on the form and program a command button.

     PopupSelectPosition(4, @XPos(ThisElement), @YPos(ThisElement))

     vReport = @PopupMenu("Server Email XXXXX;Server Email YYYYY", "EMAIL Shipping Options.")

     If @Mode() < 2 and vReport = "Server Email XXXXX" then
     {
           If End_Email > "" then
     {
                  VFromEmail_XXXXX = End_Email
     }
      ELSE
     {
                  @MsgBox("", "There is no registered email for this Requester", "")
                 ThrowFocus(Fiel or Buton)
                 Stop
     }
     
           b = @RedirectProcess("C:\Coleta\senditquiet\senditquiet.exe -s ServerEmail.com -u You_Email@XXXXX.com -p Password_Email -f You_Email@XXXXX.com -t" + " " +                        VFromEmail_XXXXX + " " + "-subject" + " " + vsubject + " " + "-body" + " "  + @Replace(vHTML," " , @NewLine()) + " " + "-files" + " "  + Field(File_Doc), "")                            

                             voutcome = b
                             if(b = "0")
                             {
                             
                                   @MsgBox("", vcomplete, "")
                                   FormCommit("")
                             }
                             else
                             {
                                   @MsgBox("E-mail was not successful", "", "")
                          
                             }
}
  

eMAIL.png ( 2 KB | 82 Downloads )
eMAIL.png

Renato Piacenti&&Manaus Amazonas Brazil&&Aqui a Floresta esta sendo preservada.&&Preserve a sua tamb�m.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Attach a document to auto email.
Reply #2 - Apr 10th, 2020 at 8:35pm
Print Post Print Post  
If you're using Sendmail, In the arguments, specify the full file path in Binary Attachment, Put "" for HTML Attachment and 1 for Encode Type

SendMail(smtp server as string, subject as string, fromaddr as string, toaddr as string, ccaddr as string, bccaddr as string, message as string, login as string, password as string, binaryattachment as string, htmlattachment as string, encodetype as int)

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Attach a document to auto email.
Reply #3 - Apr 14th, 2020 at 3:00pm
Print Post Print Post  
Ray, yes, I'm using SendMail.  Your solution is ridiculously easy!

Renato, thanks for your suggestion.

NHUser
  
Back to top
 
IP Logged