Send Google Mail From Excel - 3 Different Options

Поделиться
HTML-код
  • Опубликовано: 23 фев 2024
  • Excel macro/VBA code available in this post: excelmacroclass.blogspot.com/...
    In a previous video we saw how to send an email from Excel (via Outlook) using VBA macros. We have also seen how to send multiple emails in another video. In this video we see how send email via a Google mail or Gmail account, with or without Outlook. Using Outlook follows the process explained in previous videos with a small modification. The second option is using CDO along the mail server settings, which works for Gmail and some other mail providers too. The last option is creating your own Google script API, which only works to send via Gmail but allows to add other functionality.
    You can find many other macro examples and Excel VBA learning materials (including the Excel VBA Guide for Beginners) in the blog under the link: excelmacroclass.blogspot.com
    And yet, if you want more, you can find various Excel applications of different nature in the other blogs of the Excel Macro Mania saga:
    Excel Macro Fun (excelmacrofun.blogspot.com/)
    Excel Macro Business (excelmacrobusiness.blogspot.com/)
    Excel Macro Sports (excelmacrosports.blogspot.com/)

Комментарии • 12

  • @krn14242
    @krn14242 4 месяца назад +1

    Wow, I think I'll stick to Outlook. Thanks for the video.

  • @albertocollazo9986
    @albertocollazo9986 Месяц назад

    Could please explain how to add an attachment to gmail when the attachment is defined by a variable and not as hard coded path/filename in VBA. Example .Addattachment "c:\data\testmail.xlsx".
    I'm looking for something along the lines of .Addattachment path & fname & ".pdf" where both the path and fname are variables defined as strings in the macro.
    Thank you in advance for your help

    • @ExcelMacroMania
      @ExcelMacroMania  Месяц назад

      CDOmail.Attachment "c:\data\testmail.xlsx"

    • @albertocollazo9986
      @albertocollazo9986 Месяц назад +1

      @@ExcelMacroMania Thank you for your kind and timely answer

  • @mohanedalwhaibi576
    @mohanedalwhaibi576 28 дней назад

    i am using an app called mail came in windows 11 how can i send through it regards

    • @ExcelMacroMania
      @ExcelMacroMania  28 дней назад

      I believe Mail in Windows 11 is Outlook as part of Microsoft 365, so you should be able to send an in email from Excel using the method described in the other videos (Send Mail from Excel) or this one if you manage to setup a gmail account there.

  • @parasgupta1786
    @parasgupta1786 24 дня назад

    Hi, this is something i have been trying to replicate. I tried using the second method from your tutorial. But unable to make it work. can you please help?
    I keep getting the error "Run-time error. The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available"

    • @ExcelMacroMania
      @ExcelMacroMania  18 дней назад

      Make sure the code is correct, there was a mistake in the video that I corrected later, maybe you didn't watch the whole video. Also, go to your google account and get the exact address of the smtp server (usually is smtp.gmail.com, but can be different). Try with other port (465 vs 25 vs other?). Make sure you have added the right references to the VBA project. There might be some restrictions in your network, etc. You can find the code here: excelmacroclass.blogspot.com/2024/01/send-google-mail-from-excel-vba-macro.html

  • @proxyhn
    @proxyhn 11 дней назад

    How would one code this using typescript in excel?

    • @ExcelMacroMania
      @ExcelMacroMania  10 дней назад

      I've never used a typescript library for Excel, but there's one for JavaScript. However, I don't know why you want to do that. If you create a macro in Excel use VBA, if you create a web app, use JavaScript or TypeScript or any other.

    • @proxyhn
      @proxyhn 8 дней назад

      @@ExcelMacroManiathank you so much It worked! Just another question would you happen to know about how I could format the body text to add images and such

    • @proxyhn
      @proxyhn 4 дня назад

      ⁠@@ExcelMacroManiasorry for the double comment, I figured out how to use html for images, but how would I set up the “setrequestheader” in the third example?