macro in excel to forward an email.

Latha

Board Regular
Joined
Feb 24, 2011
Messages
146
Team,

the below code I have send emails to the list of addresses provided in Sheet1!A column.

but i would like this macro to forward a specific email to the list of recipients in Sheet1!A column.

Please help me.

Please note that the email to be forwarded contains some embedded picture also.

Code:
Sub Send_Mail_Click()
    Dim olapp As Outlook.Application
    Dim olmail As Outlook.MailItem
    Dim rng1 As Range
    Dim rng2 As Range
    Dim StrBody1 As String
    Dim StrBody2 As String
    Dim StrBody3 As String
    Dim LResult As String
    Dim i As Long
    Dim SigString As String
    Dim Signature As String
    Dim FileExtStr As String
    Dim FileFormatNum As Long
    Dim Sourcewb As Workbook
    Dim Destwb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String
    Dim sh As Worksheet
    Dim TheActiveWindow As Window
    Dim TempWindow As Window

    Application.EnableCancelKey = xlDisabled
                
        For i = 2 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
                          
                Set olapp = New Outlook.Application
                Set olmail = olapp.CreateItem(olMailItem)
        
                              
                SigString = Environ("appdata") & _
                        "\Microsoft\Signatures\Sunil_sig.htm"
            
                If Dir(SigString) <> "" Then
                    Signature = GetBoiler(SigString)
                Else
                    Signature = ""
                End If
        
                On Error Resume Next
                With olmail
                    .To = Cells(i, 2).Value
                    .CC = "Vikram.Poovanna@xxxx.com;" & "Sunil.Kumar2@xxxx.com;" & "Gaurav.Kansal@xxxx.com"
                    .Subject = "XXXXXXXXX<" & Cells(i, 3).Value & ">"
                    
                    'Set body format to HTML
                    
                     StrBody1 = "<P STYLE='font-family:Trebuchet MS (10) ;font-size:13'>Hi  " & Sheets("Sheet1").Cells(i, 2).Value & "<p>" & _
                    "<P STYLE='font-family:Trebuchet MS (10) ;font-size:13'>Please find the details of tickets and the ageing as "
                    
                    StrBody2 = Format(Now, "dd.mmm.yyyy") & " for the resolver group you own. We seek your support to reduce this to zero tickets over 10 days, and help to not beach SLA for any ticket. Providing this level of service, you will agree, will improve customer satisfaction and end user delight." & "<br><br>" & _
                    "<P STYLE='font-family:Trebuchet MS (10) ;font-size:13'>Please Note : Service desk will send this report to all of you for the next 2 weeks to enable you to track your progress.  If you need our assistance, please do let us know." & "<p>"
        
                    StrBody3 = "<P STYLE='font-family:Trebuchet MS (10) ;font-size:13'> If there would be any feedback or suggestion please write to "

                    .HTMLBody = StrBody1 & StrBody2 & StrBody3 & "<a href=""mailto:Sunil.Kumar2@xxxx.com"">sunil.kumar2@xxxx.com" & "<br>" & Signature
                    '.Attachments.Add TempFilePath & TempFileName & FileExtStr
    
                    .Send
                    
                End With
                 On Error GoTo 0
                               
    Next
        ThisWorkbook.Save
'End With
End Sub


Function GetBoiler(ByVal sFile As String) As String
'**** Kusleika
    Dim fso As Object
    Dim ts As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
    GetBoiler = ts.readall
    ts.Close
End Function
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,221,526
Messages
6,160,341
Members
451,638
Latest member
MyFlower

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top