Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Sending Outlook mail in Plain Text

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,9
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Sending Outlook mail in Plain Text
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Sending Outlook mail in Plain Text - 5/23/2001 12:43:24 AM   
  daydreamer

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
Hi!

Is there a way in VBscript to send an email in plain text? When I send one though a script, it sends it though Rich Text, even though I have the default mail setting at Plain text.

Thanks!
 
 
Post #: 1
 
 Re: Sending Outlook mail in Plain Text - 5/23/2001 12:45:02 AM   
  adminkoe

 

Posts: 117
Score: 0
Joined: 12/23/2000
From:
Status: offline
enctype="text/plain"

is the setting -- are you using CDONTS or some other ASP component??

(in reply to daydreamer)
 
 
Post #: 2
 
 Re: Sending Outlook mail in Plain Text - 5/23/2001 12:46:36 AM   
  daydreamer

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
I don't know...

Here's the code...

[color blue]
Option Explicit


Const HEADER = "[!A0][D63000]09~ProjectList"
Const FOOTER = "~-999~end"
Const SQL_PROJECTS = "SELECT * FROM projects"
Const SQL_USERS = "SELECT * FROM users"

Dim objConn, objRS, email, oolApp, projects

CreateString()
GetAddresses()
SendEmails()

function CreateString()
set objConn = CreateObject("ADODB.Connection" )
objConn.Open "DSN=POCKETMOSAIC"

set objRS = objConn.Execute ( SQL_PROJECTS )

While Not objRS.EOF
MsgBox objRS( "ProjectID" )
projects = projects & "~" & objRS( "ProjectID" )
MsgBox objRS( "ProjectName" )
projects = projects & "~" & objRS( "ProjectName" )
objRS.MoveNext
Wend

objRS.close
objConn.Close

set objRS = Nothing
set objConn = Nothing

end function

function GetAddresses()

Set oolApp = CreateObject("Outlook.Application")
Set email = oolApp.CreateItem(0)


Set objConn = CreateObject( "ADODB.Connection" )
objConn.Open "DSN=POCKETMOSAIC"

Set objRS = objConn.Execute( SQL_USERS )

While Not objRS.EOF
MsgBox objRS( "PagerAddress" )
email.Recipients.Add(objRS( "PagerAddress" ))
objRS.MoveNext
Wend

objRS.Close
objConn.Close

Set objRS = Nothing
Set objConn = Nothing

end function

function SendEmails()

email.Body = HEADER & projects & FOOTER
email.Send
Set email = Nothing
MsgBox("sent e-mails!")

end function
[/color]

Thanks!

(in reply to daydreamer)
 
 
Post #: 3
 
 Re: Sending Outlook mail in Plain Text - 5/23/2001 12:47:33 AM   
  hennykoe

 

Posts: 9
Score: 0
Joined: 5/23/2001
From:
Status: offline
ahhh -- using an outlook application -- and you said that, too. Sorry, I don't use that method, so I fear I can't be of assistance on this one.

I can offer you this tip, though... If you want to approach it from a different angle, you could go over to http://www.aspemail.com and pick up Persits' free ASP component that does a beutiful job of handling email... It's very easy to setup and start using.

Just a thought. And if you don't want to do that, then you might look into the supplied CDONTS email component that you probably already have on your server. Check over at http://www.learnasp.com or http://www.4guysfromrolla.com for some good information on how to use that component.

I like the first because I can specify which SMTP server to send from, but CDONTS works fine, too.

Sorry I couldn't be of more help.

(in reply to daydreamer)
 
 
Post #: 4
 
 Re: Sending Outlook mail in Plain Text - 5/23/2001 12:48:48 AM   
  daydreamer

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
never mind. I found out that VBscript converts outlook mail into plain text (though it didn't look like it from my point of veiw ????)

(in reply to daydreamer)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Sending Outlook mail in Plain Text Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts