User Tools

Site Tools


sending_20an_20email_20with_20attachments

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sending_20an_20email_20with_20attachments [2018/04/17 18:40]
tbest3112 Added syntax highlighting
sending_20an_20email_20with_20attachments [2021/02/20 20:08] (current)
richardrussell Add quotes around filename
Line 2: Line 2:
  
 //by Richard Russell, October 2012, corrected August 2015//\\ \\  //by Richard Russell, October 2012, corrected August 2015//\\ \\ 
-==== See also [[/​Sending%20an%20HTML%20email%20with%20optional%20attachments|Sending an HTML email with optional attachments]] ​====+See also [[/​Sending%20an%20HTML%20email%20with%20optional%20attachments|Sending an HTML email with optional attachments]] 
 \\  In the article [[/​Sending%20an%20email%20automatically|Sending an email automatically]] the procedure **PROCsendmail()** automatically sends an email using the SOCKLIB library. Listed below is a procedure which performs the same function except that you can specify one or more files to attach to the email. The final parameter is a comma-separated list of the pathnames of the file(s) you wish to attach. The procedure might be called as follows:​\\ ​ \\  In the article [[/​Sending%20an%20email%20automatically|Sending an email automatically]] the procedure **PROCsendmail()** automatically sends an email using the SOCKLIB library. Listed below is a procedure which performs the same function except that you can specify one or more files to attach to the email. The final parameter is a comma-separated list of the pathnames of the file(s) you wish to attach. The procedure might be called as follows:​\\ ​
 <code bb4w> <code bb4w>
Line 131: Line 132:
         IF FN_writelinesocket(skt%,​ "​--BB4Wsep"​)         IF FN_writelinesocket(skt%,​ "​--BB4Wsep"​)
         IF FN_writelinesocket(skt%,​ "​Content-Type:​ application/​octet-stream"​)         IF FN_writelinesocket(skt%,​ "​Content-Type:​ application/​octet-stream"​)
-        IF FN_writelinesocket(skt%,​ "​Content-Disposition:​ attachment; filename="​+file$)+        IF FN_writelinesocket(skt%,​ "​Content-Disposition:​ attachment; filename=""​"​+file$+""""​)
         IF FN_writelinesocket(skt%,​ "​Content-Transfer-Encoding:​ base64"​)         IF FN_writelinesocket(skt%,​ "​Content-Transfer-Encoding:​ base64"​)
         IF FN_writelinesocket(skt%,​ ""​)         IF FN_writelinesocket(skt%,​ ""​)
sending_20an_20email_20with_20attachments.1523990439.txt.gz · Last modified: 2018/04/17 18:40 by tbest3112