0

How can i put some design in my HTML code inside the vb.net code? I want to change the font design inside my body tag as the text in my body tag will send in users email address. Your help will greatly appreciated.

here's my code:

    mail.Subject = "SYSTEM REQUEST FORM " & txtRequestTitle.Text & " " & Format(Now(), "MM/dd/yyyy").ToString
                        mail.IsBodyHtml = True
                        mail.Body = "<html>" & _
                           "<body>" & _
                                "Dear " & DropDownApprover.Text & ",<br><br>" & _
                                "" & "The following request has been created and need your approval" & "<br>" & _
                                "" & "===============================================" & "<br>" & _
                                "" & "http://10.190.193.162/ITrequestform/LoginPage.aspx" & "<br>" & _
                                "" & "===============================================" & "<br>" & _
                                "" & "Requested By: " & lblName.Text & "<br>" & _
                                "" & "Need to Approve By: " & DropDownApprover.Text & "<br>" & _
                                "" & "===============================================" & "<br>" & _
                                "" & "Request Title: " & txtRequestTitle.Text & "<br>" & _
                                "" & "Request Category: " & DropDownCateg.Text & "<br>" & _
                                "" & "Request Item: " & DropDownCateg2.Text & "<br>" & _
                                "" & "Date Needed: " & txtDateNeeded.Text & "<br>" & _
                                "" & "===============================================" & "<br>" & _
                                "" & "For Employee: " & txtRequestEmp.Text & "<br>" & _
                                "" & "Position: " & txtEmpPost.Text & "<br>" & _
                                "" & "Description of Request: " & txtDescription.Text & "<br>" & _
                                "" & "Justification of Request: " & txtJustification.Text & "<br>" & _
                                "" & "<br>" & _
                                "Thanks," & "<br>" & _
                                "HKT Teleservices""<br>" & _
                            "</body>" & _
                          "</html>"
1

1 Answer 1

1

Add CSS in project: In SolutionExplorer --> Right click o project --> Add existing item and select Stylesheet(CSS).

Use CSS in ASPX page: You need to add refererence for this CSS file in ASPX page

<link href="Stylesheet.css" rel="stylesheet" type="text/css" />

Any style you want to apply to your body text you can write in the code below And in the Stylesheet.css file, , write this code

body{
    font-family:"Helvetica Neue" , "Lucida Grande" , "Segoe UI";
    font-size:20px;
}
Sign up to request clarification or add additional context in comments.

2 Comments

OP is creating an HTML email, so external style sheets are not going to work reliably.
Thank for the help, i just did the design inside my body tag :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.