Results 1 to 10 of 10

mail trought smtp with attached file

Threaded View

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    Bulgaria, Europe
    MS-Off Ver
    2007, 2013
    Posts
    59

    Red face mail trought smtp with attached file

    Hi all,
    I try to find solution to send mail with macros via SMTP

    Private Sub CommandButton1_Click()
    Dim Mail As New Message
    
    Dim Config As Configuration: Set Config = Mail.Configuration
    
    Config(cdoSendUsingMethod) = cdoSendUsingPort
    Config(cdoSMTPServer) = “smtp.gmail.com”
    Config(cdoSMTPServerPort) = 25
    Config(cdoSMTPAuthenticate) = cdoBasic
    Config(cdoSMTPUseSSL) = True
    Config(cdoSendUserName) = “youremail@gmail.com”
    Config(cdoSendPassword) = “yourgmailpassword”
    Config.Fields.Update
    
    Mail.To = “your_recipient@whereever.com”
    Mail.From = Config(cdoSendUserName)
    Mail.Subject = “Subject from VBA”
    Mail.HTMLBody = “Body from VBA”
    
    Mail.Send
    MsgBox “Sent”
    
    End Sub
    how to add attachment?
    thank you in advance!
    Last edited by rodich; 06-22-2015 at 04:23 AM.
    ?If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.?

    George Bernard Shaw

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SMTP E-mail server not connects Outlook
    By joe41 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 04-14-2009, 05:42 AM
  2. Recording date Excel file is attached to e-mail?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2006, 02:15 PM
  3. URGENT! Please please help me get smtp mail send working..
    By Duncan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2006, 09:55 AM
  4. [SOLVED] Sending mail from Excel with CDO - return SMTP value
    By Kent in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2005, 12:06 PM
  5. Sending mail with Excel file attached, and cell-value inserted in Subject line
    By arunjoshi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2005, 09:41 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1