I want a macros which can send a email from email client base and i'm using Zimbra, that means not from outlook, and email should be send in html format that is color and font should remain the same which i have in excel, it should pick up the range for eg: c1 to q56 it should copy paste and send it ...
File attached for your reference..
Below is the macros which i'm trying, but does not work properly
Dim rng As Range
Dim iMsg As Object
Dim iConf As Object
' Dim Flds As Variant
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
' iConf.Load -1 ' CDO Source Defaults
' Set Flds = iConf.Fields
' With Flds
' .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
' .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Fill in your SMTP server here"
' .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' End With
Set rng = Sheets("Hourly").Range("c1:q71").SpecialCells(xlCe llTypeVisible)
Set rng = ActiveSheet.Range("c1:q71")
Set rng = Sheets("hourly").Range("c1:q71")
On Error Resume Next
Set rng = Sheets("Hourly").Range("c1:q71").Selection.Special Cells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
.EnableEvents = False
.ScreenUpdating = False
Set .Configuration = iConf
.To = "email@example.com"
.CC = ""
.BCC = ""
.From = """Ashfaq"" <firstname.lastname@example.org>"
.Subject = "This is a test"
.HTMLBody = Range("c1:q71")
.EnableEvents = True
.ScreenUpdating = True
Any help will be appreciated