0% found this document useful (0 votes)
16 views2 pages

new code now save for garment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

new code now save for garment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub SendStyledEmails()

Dim outlookApp As Object, outlookMail As Object, mailBody As String


Dim ws As Worksheet, rng As Range, lastRow As Long
Dim recipientEmail As String, row As Range
Dim emailList As String

' Set the worksheet and range for the data


Set ws = ThisWorkbook.Worksheets("Sheet1")
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).row ' Last row based on column
B
Set rng = ws.Range("B2:B" & lastRow) ' Range for email addresses

' Create Outlook application object


Set outlookApp = CreateObject("Outlook.Application")

' Create a list of email addresses from column B


emailList = ""
For Each row In rng.Rows
recipientEmail = row.Value
If recipientEmail Like "*@*.*" Then ' Ensure valid email address
If emailList = "" Then
emailList = recipientEmail ' If first email, assign it directly
Else
emailList = emailList & ";" & recipientEmail ' Append email with
semicolon
End If
End If
Next row

' Compose the HTML email body with styling and color
mailBody = "<html><body style='font-family:Arial, sans-serif;line-
height:1.6;color:#333;'>" & _
"<p>Hello Sir/Ma'am,</p>" & _
"<p>Please find the details below:</p>" & _
"<p><strong style='color:#1a73e8;'>Growth System</strong> is a
Venture Capital-backed IT company providing " & _
"an <span style='color:#1a73e8;'>All-In-One Software</span> solution
for <strong>Garment Manufacturing Businesses</strong>.</p>" & _
"<p>Our software covers the entire operations of garment
manufacturing plants, including:</p>" & _
"<ul style='color:#555;'>" & _
"<li>Style creation</li><li>BOM creation</li><li>Sales
order</li><li>Production Request</li>" & _
"<li>Quick Production</li><li>Pick list</li><li>Delivery note</li>"
& _
"</ul>" & _
"<p><strong style='color:#34a853;'>Modules:</strong> Buying,
Selling, CRM, Accounting, Production, HR, Website, etc.</p>" & _
"<p><strong style='color:#ea4335;'>Key Benefits:</strong></p>" & _
"<ol style='color:#555;'>" & _
"<li>Improves efficiency</li><li>Reduces material
wastage</li><li>Clear profit tracking per order</li>" & _
"<li>Scalable business operations</li><li>Easy production cycle
tracking</li><li>Compliance management</li>" & _
"</ol>" & _
"<p>Learn more by reviewing our <a
href='https://drive.google.com/file/d/1RbAL-O8eztMy0isxuYJobpXqiepWMDdy/view'
style='color:#1a73e8;'>Company Brochure</a><br>" & _
"Book a demo: <a href='' style='color:#1a73e8;'>Schedule
Now</a></p>" & _
"<p>Best Regards,<br>Aman Saini<br><a href='tel:+916367471901'
style='color:#1a73e8;'>+916367471901</a></p>" & _
"<p style='font-size:10px;color:#888;'>Growth ERP - Revolutionizing
Garment Manufacturing</p>" & _
"</body></html>"

' Create and send the email with the list of recipients
Set outlookMail = outlookApp.CreateItem(0)
With outlookMail
.To = emailList ' All emails in one field
.Cc = "[email protected]"
.Subject = "Automate your Garment Manufacturing Process100x"
.HTMLBody = mailBody
.Importance = 2
.Send ' Send email directly
End With

End Sub

You might also like