If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.



Sending multi line email message from vb?

Visual Basic Forum

Visual Basic Forum - Sending multi line email message from vb?



Visual Basic Forum Visual Basic Forum


Reply
  #1  
Old 10-13-2004, 02:41 PM
Damon
Guest
 
Posts: n/a
Sending multi line email message from vb?

Hi,

I am trying to send an email from within vb (which is no problem) but I want
to be able to insert multiple rows within the message body of the email.
Here is my code but it is only putting in one line.

With cmd
Set .ActiveConnection = cn
.CommandType = adCmdStoredProc
.CommandText = "proc_email_admin"
.Parameters("@sbj").Value = "Tenants"
For i = LBound(name) To UBound(name)
If name(i) <> "" Then
.Parameters("@msg").Value = name(i) & " - " & address(i) & " - "
& contract_date(i) & Chr(13)
End If
Next i
.Parameters("@recipient").Value = email_address
.Execute
End With

Any help on this would be appreciated.

Thanks

Damon


Reply With Quote
  #2  
Old 10-13-2004, 02:52 PM
Bob Butler
Guest
 
Posts: n/a
Sending multi line email message from vb?

"Damon" <nonsense@nononsense.com> wrote in message
news:b8bbd.87$Lr6.78@newsfe2-gui.ntli.net

Chr(13) is a carriage return but you need both that and Line Feed to
indicate end-of line
Try using Chr$(13) & Chr$(10) or vbCRLF or vbNewLine


--
Reply to the group so all can participate
VB.Net... just say "No"

Reply With Quote
  #3  
Old 10-13-2004, 02:55 PM
Jeff Johnson [MVP: VB]
Guest
 
Posts: n/a
Sending multi line email message from vb?


"Damon" <nonsense@nononsense.com> wrote in message
news:b8bbd.87$Lr6.78@newsfe2-gui.ntli.net...

& contract_date(i) & Chr(13)

Try using vbCrLf instead of Chr$(13). A bare carriage return is not a line
terminator in any system but the Mac.


Reply With Quote
  #4  
Old 10-13-2004, 03:36 PM
Mike
Guest
 
Posts: n/a
Sending multi line email message from vb?

"Bob Butler" <tiredofit@nospam.com> wrote in message
news:ug4wWRTsEHA.3320@TK2MSFTNGP15.phx.gbl...


What's the difference between vbNewLine and vbCrLf ?

Mike


Reply With Quote
  #5  
Old 10-13-2004, 03:43 PM
Bob O`Bob
Guest
 
Posts: n/a
Sending multi line email message from vb?

Mike wrote:


None.
But there might have been in the future, had VB continued to evolve.



Bob
Reply With Quote
  #6  
Old 10-13-2004, 03:52 PM
Mike [MCP VB]
Guest
 
Posts: n/a
Sending multi line email message from vb?

"Bob O`Bob" <filterbob@yahoogroups.com> wrote in message
news:416D4D09.594F@yahoogroups.com...

Everywhere I have been has used vbCrLf. Although having seen vbNewLine, I
think I'll start using this for readability.

Mike


Reply With Quote
  #7  
Old 10-13-2004, 04:05 PM
Veign
Guest
 
Posts: n/a
Sending multi line email message from vb?

I thought vbCrLf forces a Carriage Return / Line Feed but vbNewLine uses
what ever the system requires for a new line (determines it at runtime)...

--
Chris Hanscom - Microsoft MVP (VB)
http://www.veign.com
--

"Bob O`Bob" <filterbob@yahoogroups.com> wrote in message
news:416D4D09.594F@yahoogroups.com...


Reply With Quote
  #8  
Old 10-13-2004, 04:08 PM
Bob Butler
Guest
 
Posts: n/a
Sending multi line email message from vb?

"Mike" <www.evolvedsoftwarestudios.com> wrote in message
news:eK2PipTsEHA.2144@TK2MSFTNGP10.phx.gbl

vbCRLF is *always& carriage-return & linefeed

vbNewLine is defined as a platform-dependent line terminator

AFAIK the only difference is in a VBA macro on a MAC
--
Reply to the group so all can participate
VB.Net... just say "No"

Reply With Quote
  #9  
Old 10-13-2004, 04:10 PM
Bob Butler
Guest
 
Posts: n/a
Sending multi line email message from vb?

"Mike [MCP VB]" <www.evolvedsoftwarestudios.com> wrote in message
news:%23CNSgyTsEHA.3556@TK2MSFTNGP10.phx.gbl
<cut>

IMO vbCrLf is a better choice for readability since it specifies exactly
what it contains; also, after working for years on a proprietary system
where "New Line" was a synonym for "Line Feed" I automatically read it as
not including the CR character and it still jars every time.

--
Reply to the group so all can participate
VB.Net... just say "No"

Reply With Quote
  #10  
Old 10-13-2004, 04:39 PM
Bob O`Bob
Guest
 
Posts: n/a
Sending multi line email message from vb?

Bryan Dickerson wrote:


funniest thing I've read all day.



Bob
'course, it's only 9:30 and I've been awake barely an hour
--
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
include line breaks from textarea in form in email message mscir PHP Forum 6 09-21-2009 06:34 AM
adding text strings to the Subject line and message area of a new Email Paul Ponzelli HTML Forum 4 09-28-2007 01:53 PM
Sending a DL to someone via email JC HARRIS Microsoft Excel Forum 0 10-11-2006 04:23 PM
Sending Email Mikhail Windows Server Forum 5 10-11-2005 02:42 AM
sending email from command line ram Windows Server Forum 3 11-20-2003 01:39 PM


All times are GMT. The time now is 12:36 AM. Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. Copyright 2007-20011 Internet Computer Forum






Page generated in 0.64136 seconds with 9 queries