Results 1 to 8 of 8

Thread: change font?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    9

    change font?

    Is their a way to change the font of an email being sent throught smtp? my code is as follows.

    thanks

    ryan

    Dim omsg As MailMessage = New MailMessage

    Dim sBody As String = ""

    sBody += ("Today's Date") & vbTab & vbTab & vbTab & todaysdate & vbCrLf
    sBody += "Pick Up From:" & vbTab & vbTab & vbTab & pickup & vbCrLf
    sBody += "Pick Up Address:" & vbTab & vbTab & vbTab & pickUpAddress & vbCrLf
    sBody += "Contact Person" & vbTab & vbTab & vbTab & contact & vbCrLf
    sBody += "What To Pick Up:" & vbTab & vbTab & vbTab & what & vbCrLf
    sBody += "What To Deliver" & vbTab & vbTab & vbTab & deliverto1 & vbCrLf
    sBody += "Delivery Address" & vbTab & vbTab & vbTab & deliverAddress & vbCrLf
    sBody += "Contact Person" & vbTab & vbTab & vbTab & deliverTo & vbCrLf
    sBody += "What to Deliver" & vbTab & vbTab & vbTab & whattoDeliver & vbCrLf
    sBody += "Delivery Instructions" & vbTab & vbTab & special & vbCrLf
    omsg.Body = sBody
    mymessage.Body = omsg.Body
    mymessage.From = "Sales"
    mymessage.To = "mail@brprint.com"
    mymessage.Subject = "delivery"
    mymessage.BodyFormat = System.Web.Mail.MailFormat.Text

    System.Web.Mail.SmtpMail.SmtpServer = "server1"
    System.Web.Mail.SmtpMail.Send(mymessage)
    MessageBox.Show("E-mail sent to Delivery")

  2. #2
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Re: change font?

    send it as html

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    9

    Re: change font?

    is that the only way?

  4. #4
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: change font?

    i had this problem a while ago and i left it unsolved.

    my project needed to make the user format the email body inside rtf control (Rich Text format). after that i tried to convert it from rtf to html but i failed miserably.

    i am insterested to hear if any one have a solution

    thx in advance

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: change font?

    when you send an email as text, it will be displayed using the default font that their email client uses to display text, a standard text email doesn't contain any formatting info.... like dotnetboy said.. you need to sent it as HTML, so you can mark up the text with your own desired font.. keep in mind the end user needs to have that font on their system to view it properly.. otherwise their email client will render the HTML with a default font like arial or tahoma...

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    9

    Re: change font?

    Thanks. Ill just do that. The computer is for that purpose only. I got one more question. I havent dont any type of prog in the last 2 years so i'm rusty. I want to bold the label when the text box has focus. in my head i know the vb 6 way to do it but cant remember how in .net

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: change font?

    VB Code:
    1. Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
    2.         label1.Font = New Font(label1.Font, FontStyle.Bold)
    3.     End Sub
    4.  
    5.     Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
    6.         label1.Font = New Font(label1.Font, FontStyle.Regular)
    7.     End Sub

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    9

    Talking Re: change font?

    i was kind of in that direction but you are the bomb thanks

    ryan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width