Skip to main content

VB 6 Send Email

VB Send Email with a HTML Format body

Private Sub Command1_Click()
Dim EmailList, Mailbod As String, Myfile
Dim objOutlook As Outlook.Application
Dim newapp As Outlook.MailItem, objRecip As Outlook.Recipient
Dim objRWhtm As Outlook.Attachment
Dim StrBody As String
Dim Myfile As String

StrBody="<font color='red'>Hello World</font>"
Myfile="C:\Temp\attached.doc
 
Set newapp = Outlook.Application.CreateItem(olMailItem)
Set objOutlook = CreateObject("Outlook.Application")
Set objRecip = newapp.Recipients.Add("user@email.com") 'list of recipients for the message
'Set objRWhtm = newapp.Attachments.Add(Myfile) 'optional command if you want to attach a file
'specify MyFile as file path for desired file to be sent
     
newapp.Subject = Mailbod 'Sets the subject of the e-mail
newapp.HTMLBody = StrBody 'send html format email
'newapp.Body = "Hello World" 'Plain Text Body
newapp.Send 'Sends your e-mail
newapp.Display 'Show you the e-mail you just sent.

End Sub


Comments

Popular posts from this blog

Greenbelt Chapel

Chapel of Santo Niño de Paz Greenbelt Chapel, also known as the Chapel of Santo Niño de Paz, is one of those unique Roman Catholic chapels located in Makati, Philippines, inside the Greenbelt Mall complex. This open-air, circular-design edifice was built in the early 1980s and is regarded as unique compared with most conventional churches. Designed to blend in with nature, the chapel architecture seems to float above a garden oasis in the middle of Makati business district, all but covered with greenery. It is a favorite among the employees and passersby, since it has daily Masses, confessions, and other religious activities. Its minimalist style, in which concrete elements are utilized symbolically and complemented by natural elements, also evokes silent and meditative settings among visitors and regular mass goers.

Rizal Park (Luneta Park)

Luneta Park, formally named Rizal Park, is a massive 58-hectare urban oasis located in the midst of Manila, Philippines. A place teeming with historical value and part of the largest parks in Asia, as it is the place where Dr. José Rizal, the country's national hero, was executed way back in 1896, giving rise to the revolution against Spanish colonization in the Philippines. And in the center of this park, as one approaches it, stands the monumental granite structure, the Rizal Monument, to which sentinels are posted. Both locals and tourists throng to the place to do their tribute. The lawns are very large, but little can be said, although these avenues flanked by trees and those peculiarly designed gardens like the Chinese and Japanese Gardens do serve to be a perfect retreat amidst the hustle and bustle of the city. Save the green spots, there are cultural and recreational facilities in Luneta Park. Colored light and music shows are staged at the Musical Dancing Fountain, and...