3
Answers

How to bind dynamically subject text in email body in bold i

Amit Kumar

Amit Kumar

8y
368
1
How to bind dynamically subject text in email body in bold in vb.net
and subject comes from database.
Answers (3)
0
Raja T

Raja T

NA 7.4k 6k 8y
Hi, Please send me ur code what you tried???
0
Amit Kumar

Amit Kumar

NA 3.5k 203.4k 8y
It is not working...
0
Raja T

Raja T

NA 7.4k 6k 8y
HiAmit Kumar, When you add the subject from db at the time add html tag
try like
<b> <Subject from DB> </b>
For Example:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("username@gmail.com", "password")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
e_mail = New MailMessage()
e_mail.From = New MailAddress(txtFrom.Text)
e_mail.To.Add(txtTo.Text)
e_mail.Subject = "<b> Email Sending </b>"
e_mail.IsBodyHtml = False
e_mail.Body = txtMessage.Text
Smtp_Server.Send(e_mail)
MsgBox("Mail Sent")
Catch error_t As Exception
MsgBox(error_t.ToString)
End Try
End Sub