Announcement

Collapse
No announcement yet.

gbSendMail - Send Emails (Discussion)

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

  • #21
    But, , if I were going to have a GoDo list:

    1. Binary attachments
    2. Multiple To: address
    3. BC/CC
    4. Support for HTML and plain text bodies
    5. Consistency/broader support for various formats ... "John <[email protected]>", etc.

    I know that some of these are already supported by the original author's code. I just didn't have my scope for gbSendMail set that wide.

    So if you want to add one of those features, you can check the original author's code to see if it's already available.

    Comment


    • #22
      Gary,
      1) Binary attachments are fairly straightforward, they're usually just base64 encoded -- one of the very first PB SMTP demos (i think in \pb\samples\) shows how to do this

      2) Multiple to: address
      This is also related to 3) (BCC/CC)
      Basically, to send to multiple addresses you simply send "RCPT TO <nextemailaddress>" over and over for each address - you should receive a 250 "success" error code for each valid email address. The resulting email by default is a BCC. If you want to make it a CC (so that ppl can see who else you've sent it to), you simply include the CC field in the email header (alongside the To, From, Subject, Date, X-Mailer etc etc header fields).

      4) Support for HTML is kinda easy enough...
      Here is a "PLAINTEXT HTML-based" email, that simply says "Hello world"... (note - plaintext, but still with a specified formatting ... with plaintext though you dont actually need to specify these fields like 'Content-Type')
      Code:
      Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
      Content-Transfer-Encoding: 7bit
       
      Hello world
      HTML formatted (you'll notice it first has the "plaintext" version, then the HTML version):
      Code:
      Content-Type: multipart/alternative;
      	boundary="----=_NextPart_000_04D8_01CFB33A.E2EC5D50"
      
      This is a multi-part message in MIME format.
      
      ------=_NextPart_000_04D8_01CFB33A.E2EC5D50
      Content-Type: text/plain;
      	charset="iso-8859-1"
      Content-Transfer-Encoding: quoted-printable
      
      Hello world
      ------=_NextPart_000_04D8_01CFB33A.E2EC5D50
      Content-Type: text/html;
      	charset="iso-8859-1"
      Content-Transfer-Encoding: quoted-printable
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      <HTML><HEAD>
      <META http-equiv=3DContent-Type content=3D"text/html; =
      charset=3Diso-8859-1">
      <META content=3D"MSHTML 6.00.2900.5512" name=3DGENERATOR>
      <STYLE></STYLE>
      </HEAD>
      <BODY bgColor=3D#ffffff>
      <DIV><FONT face=3DArial size=3D2>Hello world</FONT></DIV></BODY></HTML>
      ------=_NextPart_000_04D8_01CFB33A.E2EC5D50--
      Some of these are pretty "raw/native" features though so while they're fairly straight-forward with pure TCP I'm not sure how to accomplish these differences if using say, CDO for example, unless it has some option to support these, although Jose posted a list of about 30 or so options/parameters for that so who knows! HTML email is so common though so im sure there'd be some way, and I know just the man who'd know
      Last edited by Wayne Diamond; 8 Aug 2014, 07:54 AM.
      -

      Comment


      • #23
        > I'm not sure how to accomplish these differences if using say, CDO for example, unless it has some option to support these,

        Instead of pMessage.TextBody, use pMessage.HtmlBody.
        Forum: http://www.jose.it-berater.org/smfforum/index.php

        Comment


        • #24
          Originally posted by Wayne Diamond View Post
          and I know just the man who'd know
          ... *tops up Jose's drink!*
          I love your work mate, have a great weekend!
          -

          Comment


          • #25
            Documentation of the IMessage interface:

            http://msdn.microsoft.com/en-us/libr...chg.10%29.aspx

            IMessage Interface
            Attachments Property
            AutoGenerateTextBody Property
            BCC Property
            BodyPart Property
            CC Property
            Configuration Property
            DataSource Property
            DSNOptions Property
            EnvelopeFields Property
            Fields Property
            FollowUpTo Property
            From Property
            HTMLBody Property
            HTMLBodyPart Property
            Keywords Property
            MDNRequested Property
            MimeFormatted Property
            Newsgroups Property
            Organization Property
            ReceivedTime Property
            ReplyTo Property
            Sender Property
            SentOn Property
            Subject Property
            TextBody Property
            TextBodypart Property
            To Property
            AddAttachment Method
            AddRelatedBodyPart Method
            CreateMHTMLBody Method
            Forward Method
            GetInterface Method
            GetStream Method
            Post Method
            PostReply Method
            Reply Method
            ReplyAll Method
            Send Method
            Last edited by José Roca; 8 Aug 2014, 11:12 AM.
            Forum: http://www.jose.it-berater.org/smfforum/index.php

            Comment


            • #26
              To note... Many servers throttle traffic to save cost (they may say to increase security). Personally, I send messages in batches of no more than 5 ("to" addresses and/or separate messages) without disconnecting, waiting a second or two, then reconnecting and continuing. This seems to keep the sending server from getting "annoyed". Many servers allow 10 with no issues, but in the "wild", I never know what servers my customers will use, so I use 5 to be safer.

              Comment


              • #27
                Hi Gary,

                Am I wrong or the email "From" and "To" are swapped?

                Regards,
                Last edited by Manuel Valdes; 8 Aug 2014, 05:42 PM.

                Comment


                • #28
                  Hi Manuel,

                  The "From" seems to sync up when I send myself an email.

                  I've got to leave for a little while, but will do some more checking when I get back.

                  Which gbSendMail settings were you using? Can you send me an image of what you used (no password, of course!).

                  Comment


                  • #29
                    Manuel!
                    Thanks so much for the catch. Here's what I had done wrong (in the new Squires class code method) ...
                    Code:
                       cMail.SendFrom     = sTo
                       cMail.SendTo       = sFrom
                    The fixe has been uploaded (v1.21)

                    Comment


                    • #30
                      Hi Gary,

                      Sorry for not answering in time. I tested it in my job office and then left to home. Many thanks for your nice work putting that code together, really useful. And many thanks for all your support to these forums.

                      Best regards,
                      Last edited by Manuel Valdes; 8 Aug 2014, 10:07 PM.

                      Comment


                      • #31
                        Nice Job

                        Nice job, guys!
                        How I can request a reading recept when sending a mail?
                        Thanks

                        Comment


                        • #32
                          Hi Emanuele!
                          Sorry, but I don't know the answer myself. Perhaps someone will chime in here shortly ...

                          Comment


                          • #33
                            Googling "mailer.ConfirmRead" and "mailer.ConfirmReceipt" may get you started...

                            Pierre

                            Comment


                            • #34
                              Email program

                              This looks cool...
                              Thanks
                              Jim
                              Last edited by Jim Seekamp; 17 Aug 2015, 02:59 PM.
                              Jim Seekamp

                              Comment


                              • #35
                                The only one I can get to work with GMAIL is Jose Roca's using port 465 and checking authentication and SSL in settings.
                                I don't think the others have the option to use both authenticate and encrypt in the settings.

                                GMail doesn't work here without lowering security settings https://myaccount.google.com/lesssecureapps

                                Is there a way to get Jose Roca's (or one of the others) to work without lowering security using GMail?


                                https://support.google.com/accounts/.../6010255?hl=en

                                https://github.com/piwik/piwik/issues/8613

                                https://www.wpsitecare.com/gmail-smtp-settings/


                                Found this link Authorizing Your App with Gmail
                                https://developers.google.com/gmail/api/auth/about-auth

                                Keeps getting better
                                https://developers.google.com/gmail/api/auth/web-server

                                Created an OAuth 2.0 client ID and password using
                                https://console.developers.google.com under Creditials

                                Trying to figure out how to present the the ID to the Google SMTP Server.
                                I think once this is done Google will recognize the machine and security won't need to be reduced.
                                If anyone has done this, please advise.
                                Last edited by Mike Doty; 11 Nov 2017, 06:00 PM.
                                CMD shortcut to open any location:
                                %windir%\system32\cmd.exe /k " cd\ & x: & cd x:\xxxx
                                Change to run as administrator
                                How long is an idea? Write it down.

                                Comment


                                • #36
                                  Hi
                                  Where do i get the 2 INC files from
                                  Ian
                                  Ian Docksey, Trinitarian Bible Society

                                  Comment


                                  • #37
                                    Just a wild guess here... Are you missing CDOSYS.INC and OLE2UTILS.INC? If so, install Jose' Roca includes.

                                    Comment

                                    Working...
                                    X