Results 1 to 10 of 30

Thread: Tests and Notes for EMail Threads

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    In support of this forum post
    https://eileenslounge.com/viewtopic.php?f=27&t=38916
    This is the example coding used throughout the next posts

    Part 1
    Log in and enable 2 – Step Verification https://excelfox.com/forum/showthrea...ll=1#post19038
    https://excelfox.com/forum/showthrea...age3#post19038

    Part 2 Generate Apps Password https://excelfox.com/forum/showthrea...ll=1#post19039
    https://excelfox.com/forum/showthrea...age3#post19039

    Part 3 Using a gmail "Apps password" in a CDO send mail coding https://excelfox.com/forum/showthrea...ll=1#post19040
    https://excelfox.com/forum/showthrea...age3#post19040




    Code:
    Option Explicit
    Sub SendUsinggmail()
    Dim ws As Worksheet: Set ws = ThisWorkbook.Worksheets.Item(1)
    Rem  EMail send 'For info see:  http://www.excelfox.com/forum/showthread.php/2233-Urgent-support-needed-Multiple-emails-multiple-Excel-workbooks-at-once#post10519
    'Working at my end With my With End With Created LCDCW Library, (LCD 1.0 Library ) (Linking Configuration Data_Cods Wollups)
        With CreateObject("CDO.Message") ' -Linking Cods Wollups--------
        Dim LCD_CW As String: Let LCD_CW = "http://schemas.microsoft.com/cdo/configuration/"
         .Configuration(LCD_CW & "smtpusessl") = True '
         .Configuration(LCD_CW & "smtpauthenticate") = 1  '
        '  ' Sever info
         .Configuration(LCD_CW & "smtpserver") = "smtp.gmail.com"
        '  The mechanism to use to send messages.
         .Configuration(LCD_CW & "sendusing") = 2
         .Configuration(LCD_CW & "smtpserverport") = 25
        '
         .Configuration(LCD_CW & "sendusername") = "mail2taste@gmail.com" ' 
         .Configuration(LCD_CW & "sendpassword") = "mvxyzxjfgxabcbwo"  ' - This is the so called  "App Pasword"     '_- https://eileenslounge.com/viewtopic.php?p=300957#p300957  '  "FallyOverStkPlop.!*"    ' "qkl4diPlopsyPoo.!*"
    '     .Configuration(LCD_CW & "sendusername") = "YourEMailAddress"
    '     .Configuration(LCD_CW & "sendpassword") = "YourEMailPassword"
        ' Optional - How long to try
         .Configuration(LCD_CW & "smtpconnectiontimeout") = 30 '
        ' Intraction protocol is Set/ Updated
         .Configuration.Fields.Update '
        'End With ' ----------------------      my Created  LCDCW Library
        'With ' --- ' Data to be sent------     my Created  LCDCW Library
         Dim strHTML As String: Let strHTML = "

    " & ws.Range("B2").Value & "

    How are you Today?

    " .To = "doc.aelstein@gmail.com" ' .CC = "doc.aelstein@t-online.de" '.CC = "doc.aelstein@gmail.com" '.CC = "excelvbaexp@gmail.com" '.BCC = "" .from = """SendingFrom gmail"" " .Subject = ws.Range("A2").Value .htmlbody = strHTML '.AddAttachment ThisWorkbook.Path & "AnyFile.xyz" .Send ' Do it End With ' CreateObject("CDO.Message") -----my Created LCDCW Library End Sub




    That coding when run, will send some simple text from range A2:B2

    https://i.postimg.cc/tTxWWhK0/Coding...-via-gmail.jpg
    Coding send simple text via gmail.JPG
    Attached Files Attached Files
    Last edited by DocAElstein; 11-15-2022 at 05:43 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Tests and Notes on Range Referrencing
    By DocAElstein in forum Test Area
    Replies: 70
    Last Post: 02-20-2024, 01:54 AM
  2. Table Tests. And Thread Copy Tests No Reply needed
    By DocAElstein in forum Test Area
    Replies: 1
    Last Post: 11-20-2018, 01:11 PM
  3. Table Tests. And Thread Copy Tests No Reply needed
    By DocAElstein in forum Test Area
    Replies: 1
    Last Post: 11-20-2018, 01:11 PM
  4. Replies: 9
    Last Post: 07-02-2013, 06:59 PM
  5. Send Lotus Notes Email Using VBA
    By ramakrishnan in forum Excel Help
    Replies: 1
    Last Post: 09-08-2011, 09:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •