Home / Sample Macros / Send Email

Send Email


Following macro sends email along with document as an attachment.

  1. Public Sub SendEmail()
  2.     ThisWorkbook.HasRoutingSlip = True 
  3.     With ThisWorkbook.RoutingSlip 
  4.        .Recipients = Array("$mailid") ' Enter mail ids separated by comma
  5.        .Subject = "$subject"          ' Enter your subject here
  6.        .Message = "$message"          ' Enter your message here 
  7.     End With 
  8.     ThisWorkbook.Route 
  9. End Sub

    Prince Geremy Chinanu  06 Jul 2017 
    how do I prevent the code from sending the workbook as attachment
    Hi Prince, Please use the option .AttachWorkbook = False to stop sending workbook as attachment in the mail.
    WeiYo Chen  17 Apr 2023 
    Could I change the send address to my email address, right now it will send from noreply@notifications.zohosheet.com. not like the one when I use "File>Email As Attachment..." , it will send from my address.
    Samuel Ponraj P  21 Apr 2023 
    Hello Weiyo Chen,

    We would like to inform you that you can add the sender address with recipients, and message by following the below-mentioned steps.
    .Message = MessagetoSend
    .Sender = "sender email address"
    Please note that this address should be same as sender's email address else mail will still be sent from the same notification mail address to avoid unnecessary confusion and protection policies.



     RSS of this page