Announcement

Collapse
No announcement yet.

EMAIL: Message Body plus Email Attachement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EMAIL: Message Body plus Email Attachement

    I need to be able to send an email with a file attached (easy)
    and I have to be able to have a canned message as well in
    the body. How do I do that?

    This is what I have right now

    Code:
    TCP PRINT hTCP, "Subject: " & subjectText$
       TCP PRINT hTCP, "Date: Thu, 28 Jun 2001 20:51:22 -0500"
       TCP PRINT hTCP, "Return-Receipt-To: Open RFI  <" & fromText$ & ">"
       TCP PRINT hTCP, "MIME-Version: 1.0"
       TCP PRINT hTCP, "X-Mailer: " & $programID
       TCP PRINT hTCP, "Content-Type: multipart/mixed"
       TCP PRINT hTCP, ""
       TCP PRINT hTCP, "Content-Type: TEXT/PLAIN; charset=ISO-8859-1"
       TCP PRINT hTCP, ""
    
       REPLACE $Crlf & "." WITH $Crlf & ".." IN msgText$
       TCP PRINT hTCP, msgText$
       TCP PRINT hTCP, "."
    
       TCP PRINT hTCP, "Content-Type: application/octet-stream; name=" + "greg.dat"
       TCP PRINT hTCP, "Content-transfer-encoding: base64"
       TCP PRINT hTCP, ""
       TCP PRINT hTCP, sMIME$
       TCP PRINT hTCP, "."
    ------------------
    -Greg
    -Greg
    [email protected]
    MCP,MCSA,MCSE,MCSD

  • #2
    If you download the source code (free) for ddsmtp from my web-site: http://dickinson.basicguru.com it will provide an example of how to do this. It also provides a canned library (one function call) to send email with subject/note/attachments via smtp. The library is free as long as you just take the source and compile it yourself. i sell the compiled version as shareware to those without pbcc/pbdll.

    Best Regards,
    Don

    ------------------
    dickinson.basicguru.com
    Don Dickinson
    www.greatwebdivide.com

    Comment


    • #3
      Sorry don, but I couldn't get your code to compile.

      ------------------
      -Greg
      -Greg
      [email protected]
      MCP,MCSA,MCSE,MCSD

      Comment


      • #4
        Gregery,
        What file are you compiling and what compiler are you using? It works for me (compiling pbsmtp32.bas with pbdll6).
        If not, there's no reason to compile and external dll. you should be able to include pb_smtp.bas into your app and it should work.
        Finally, if none of those works, the code does give the answer to your previous question. It contains routines to mime attach a file to the email.

        If you have trouble compiling something, just let me know what error you're getting and I can probably help.

        --Don

        ------------------
        dickinson.basicguru.com
        Don Dickinson
        www.greatwebdivide.com

        Comment

        Working...
        X