|
-
Aug 31st, 2005, 09:50 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] How do I create a paragraph in an e-mail?
Hello everybody.
I have created a program that sends an e-mail but the body of my e-mail always creates one line of messages. For example, if I want to write Dear Tommy on the first paragraph and Dear Jhonny on the next. I can't seem to create paragraphs.
-
Aug 31st, 2005, 09:59 PM
#2
Re: How do I create a paragraph in an e-mail?
You can add a carriage return and a line feed inbetween your text.
VB Code:
MessageBox.Show("Dear Tommy" & ControlChars.CrLf & "Dear Jhonny")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 31st, 2005, 10:07 PM
#3
Re: How do I create a paragraph in an e-mail?
Runtime alert! ControlChars.CrLf? Environment.NewLine.
-
Aug 31st, 2005, 10:22 PM
#4
Re: How do I create a paragraph in an e-mail?
ControlChars is part of MS VB Namespace. You have said and provn that its the same thing but just not viewed as .NET code. 
Anyways, lets not get into another looooog thread about MSVB Namespace.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 31st, 2005, 10:33 PM
#5
Thread Starter
Hyperactive Member
Re: How do I create a paragraph in an e-mail?
Hmmm.... It didn't worked. There is defininitely something wrong with my code. Here have a look see.
VB Code:
'Week 2
Imports System.Web.Mail
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Label1.Text = "Thomas"
Button1.Text = "Submit"
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim AutoEmail As New MailMessage
AutoEmail.To = Label2.Text
AutoEmail.Subject = "Test subject from VB.NET"
AutoEmail.BodyFormat = MailFormat.Html
AutoEmail.Body = "Ian" & ControlChars.CrLf & "Paul"
AutoEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25")
System.Threading.Thread.Sleep(200)
SmtpMail.SmtpServer = "192.168.11.11"
System.Threading.Thread.Sleep(200)
SmtpMail.Send(AutoEmail)
End Sub
End Class
-
Aug 31st, 2005, 10:34 PM
#6
Re: How do I create a paragraph in an e-mail?
Did you try Johns "Environment.NewLine" or any othe variations
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 31st, 2005, 10:45 PM
#7
Thread Starter
Hyperactive Member
Re: How do I create a paragraph in an e-mail?
Hmmm.... Environment.NewLine does not work also. Can you give me more, what you call variations because I am a newbie at VB.NET.
The problem is when I open my e-mail at Yahoo the body of the e-mail says "Ian Paul" instead of "Ian <next line> Paul".
-
Aug 31st, 2005, 10:46 PM
#8
Re: How do I create a paragraph in an e-mail?
You've set your mail format as HTML so perhaps you need to use HTML tags. Try using <p> or <br> tags.
-
Aug 31st, 2005, 10:51 PM
#9
Thread Starter
Hyperactive Member
Re: How do I create a paragraph in an e-mail?
 Originally Posted by jmcilhinney
You've set your mail format as HTML so perhaps you need to use HTML tags. Try using <p> or <br> tags.
WOW!!!! It worked. Thanks man, you are the best.
-
Aug 31st, 2005, 10:53 PM
#10
Re: How do I create a paragraph in an e-mail?
*basking in admiring glow* 
Cool. Don't forget to resolve your thread from the Thread Tools menu.
-
Aug 31st, 2005, 11:01 PM
#11
Thread Starter
Hyperactive Member
Re: How do I create a paragraph in an e-mail?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|