Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > CDONTS NewMail

Reply
Thread Tools

CDONTS NewMail

 
 
Earl Partridge
Guest
Posts: n/a
 
      06-07-2008
If there's a newgroup for this subject, please point me to it...
Is it possible to set the font size of the body of the text?
Earl

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      06-07-2008

"Earl Partridge" <> wrote in message
news:...
>If there's a newgroup for this subject, please point me to it...
>Is it possible to set the font size of the body of the text?


First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
exampel of sending an
email with CDOSYS:-

Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSMTPServer =
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPickupDirectory =
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
Const cdoSMTPServerPort =
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"

Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2

Dim oMsg : Set oMsg = CreateObject("CDO.Message")
Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

With oConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mysmtp.myserver.com"
.Item(cdoSMTPServerPort) = 25
.Update
End With

oMsg.From = "Me <>"
oMsg.To = "Bloke <>"
oMsg.Subject = "Test"
oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
World</body></html>"
Set oMsg.Configuration = oConfig

oMsg.Send


Note the HTMLBody uses a style that defines the font size.

Of course this assumes you aren't asking how to make the size of font in a
plain text message the bigger. The answer to that would be; you can't use a
HTMLBody instead.


--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
 
 
 
Old Pedant
Guest
Posts: n/a
 
      06-08-2008
A goof in that, Anthony:

oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
World</body></html>"

Ummm...that NEEDS to be

oMsg.HTMLBody = "<html><body style=""font-size:14pt"">Hello
World</body></html>"

Doubled quotes to embed them, of course.


"Anthony Jones" wrote:

>
> "Earl Partridge" <> wrote in message
> news:...
> >If there's a newgroup for this subject, please point me to it...
> >Is it possible to set the font size of the body of the text?

>
> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
> exampel of sending an
> email with CDOSYS:-
>
> Const cdoSendUsingMethod =
> "http://schemas.microsoft.com/cdo/configuration/sendusing"
> Const cdoSMTPServer =
> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
> Const cdoSMTPServerPickupDirectory =
> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
> Const cdoSMTPServerPort =
> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
>
> Const cdoSendUsingPickup = 1
> Const cdoSendUsingPort = 2
>
> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
>
> With oConfig.Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
> .Item(cdoSMTPServerPort) = 25
> .Update
> End With
>
> oMsg.From = "Me <>"
> oMsg.To = "Bloke <>"
> oMsg.Subject = "Test"
> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
> World</body></html>"
> Set oMsg.Configuration = oConfig
>
> oMsg.Send
>
>
> Note the HTMLBody uses a style that defines the font size.
>
> Of course this assumes you aren't asking how to make the size of font in a
> plain text message the bigger. The answer to that would be; you can't use a
> HTMLBody instead.
>
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>
>

 
Reply With Quote
 
Earl Partridge
Guest
Posts: n/a
 
      06-09-2008
Thanks, would I need to get my hosting service to do any configuration
change to accept CDOSYS?
Earl

"Anthony Jones" <> wrote in message
news:...
>
> "Earl Partridge" <> wrote in message
> news:...
>>If there's a newgroup for this subject, please point me to it...
>>Is it possible to set the font size of the body of the text?

>
> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
> exampel of sending an
> email with CDOSYS:-
>
> Const cdoSendUsingMethod =
> "http://schemas.microsoft.com/cdo/configuration/sendusing"
> Const cdoSMTPServer =
> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
> Const cdoSMTPServerPickupDirectory =
> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
> Const cdoSMTPServerPort =
> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
>
> Const cdoSendUsingPickup = 1
> Const cdoSendUsingPort = 2
>
> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
>
> With oConfig.Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
> .Item(cdoSMTPServerPort) = 25
> .Update
> End With
>
> oMsg.From = "Me <>"
> oMsg.To = "Bloke <>"
> oMsg.Subject = "Test"
> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
> World</body></html>"
> Set oMsg.Configuration = oConfig
>
> oMsg.Send
>
>
> Note the HTMLBody uses a style that defines the font size.
>
> Of course this assumes you aren't asking how to make the size of font in a
> plain text message the bigger. The answer to that would be; you can't use
> a
> HTMLBody instead.
>
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>



 
Reply With Quote
 
Mike Brind [MVP]
Guest
Posts: n/a
 
      06-09-2008
If your hoster is using Win 2k or above, then no. CDO became the default
mailing component from Win 2k. In fact, you are more likely to have
problems getting them to set up CDONTS.

--
Mike Brind
Microsoft MVP - ASP/ASP.NET


"Earl Partridge" <> wrote in message
news:...
> Thanks, would I need to get my hosting service to do any configuration
> change to accept CDOSYS?
> Earl
>
> "Anthony Jones" <> wrote in message
> news:...
>>
>> "Earl Partridge" <> wrote in message
>> news:...
>>>If there's a newgroup for this subject, please point me to it...
>>>Is it possible to set the font size of the body of the text?

>>
>> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
>> exampel of sending an
>> email with CDOSYS:-
>>
>> Const cdoSendUsingMethod =
>> "http://schemas.microsoft.com/cdo/configuration/sendusing"
>> Const cdoSMTPServer =
>> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
>> Const cdoSMTPServerPickupDirectory =
>> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
>> Const cdoSMTPServerPort =
>> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
>>
>> Const cdoSendUsingPickup = 1
>> Const cdoSendUsingPort = 2
>>
>> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
>> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
>>
>> With oConfig.Fields
>> .Item(cdoSendUsingMethod) = cdoSendUsingPort
>> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
>> .Item(cdoSMTPServerPort) = 25
>> .Update
>> End With
>>
>> oMsg.From = "Me <>"
>> oMsg.To = "Bloke <>"
>> oMsg.Subject = "Test"
>> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
>> World</body></html>"
>> Set oMsg.Configuration = oConfig
>>
>> oMsg.Send
>>
>>
>> Note the HTMLBody uses a style that defines the font size.
>>
>> Of course this assumes you aren't asking how to make the size of font in
>> a
>> plain text message the bigger. The answer to that would be; you can't
>> use a
>> HTMLBody instead.
>>
>>
>> --
>> Anthony Jones - MVP ASP/ASP.NET
>>
>>

>
>



 
Reply With Quote
 
Earl Partridge
Guest
Posts: n/a
 
      06-09-2008
I already have CDONTS working with my host's server. I was just trying to
figure out how change the font size in CDONTS. If I switch to CDOSYS, do I
need to build in those 6 Const lines?
Earl


"Mike Brind [MVP]" <> wrote in message
news:...
> If your hoster is using Win 2k or above, then no. CDO became the default
> mailing component from Win 2k. In fact, you are more likely to have
> problems getting them to set up CDONTS.
>
> --
> Mike Brind
> Microsoft MVP - ASP/ASP.NET
>
>
> "Earl Partridge" <> wrote in message
> news:...
>> Thanks, would I need to get my hosting service to do any configuration
>> change to accept CDOSYS?
>> Earl
>>
>> "Anthony Jones" <> wrote in message
>> news:...
>>>
>>> "Earl Partridge" <> wrote in message
>>> news:...
>>>>If there's a newgroup for this subject, please point me to it...
>>>>Is it possible to set the font size of the body of the text?
>>>
>>> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
>>> exampel of sending an
>>> email with CDOSYS:-
>>>
>>> Const cdoSendUsingMethod =
>>> "http://schemas.microsoft.com/cdo/configuration/sendusing"
>>> Const cdoSMTPServer =
>>> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
>>> Const cdoSMTPServerPickupDirectory =
>>> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
>>> Const cdoSMTPServerPort =
>>> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
>>>
>>> Const cdoSendUsingPickup = 1
>>> Const cdoSendUsingPort = 2
>>>
>>> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
>>> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
>>>
>>> With oConfig.Fields
>>> .Item(cdoSendUsingMethod) = cdoSendUsingPort
>>> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
>>> .Item(cdoSMTPServerPort) = 25
>>> .Update
>>> End With
>>>
>>> oMsg.From = "Me <>"
>>> oMsg.To = "Bloke <>"
>>> oMsg.Subject = "Test"
>>> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
>>> World</body></html>"
>>> Set oMsg.Configuration = oConfig
>>>
>>> oMsg.Send
>>>
>>>
>>> Note the HTMLBody uses a style that defines the font size.
>>>
>>> Of course this assumes you aren't asking how to make the size of font in
>>> a
>>> plain text message the bigger. The answer to that would be; you can't
>>> use a
>>> HTMLBody instead.
>>>
>>>
>>> --
>>> Anthony Jones - MVP ASP/ASP.NET
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Old Pedant
Guest
Posts: n/a
 
      06-09-2008
> I already have CDONTS working with my host's server. I was just trying to
> figure out how change the font size in CDONTS.


Oh, well, then it's easy: But you can *ONLY* specify font size *IF* you
sent HTML Email. You can't do it if you are sending plain text email.

So if your courrent mail body looks something like:
mail.body = "Hello, " & name & vbNewLine _
& "Thanks for your inquiry." & vbNewLine _
& "We'll get back to you ASAP."

You'll need to start using HTML line breaks, etc, in place of just the
newlines (or CRLF or whatever you are using), and *TELL* CDONTS that you are
using HTML, thus:

mail.MailFormat = 0 ' specifies HTML
mail.BodyFormat = 0 ' ditto
mail.body = "Hello, " & name & "<p>" & vbNewLine _
& "Thanks for your inquiry.<br/>" & vbNewLine _
& "We'll get back to you ASAP.<p>"

You might want to check this out:
http://www.aspfaqs.com/aspfaqs/ShowC...y.asp?CatID=10
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      06-10-2008
"Old Pedant" <> wrote in message
news:206790C0-112C-4B18-A7E6-...
> A goof in that, Anthony:
>
> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
> World</body></html>"
>
> Ummm...that NEEDS to be
>
> oMsg.HTMLBody = "<html><body style=""font-size:14pt"">Hello
> World</body></html>"
>
> Doubled quotes to embed them, of course.
>



Oooops. Nothing is so easy that it doesn't need testing.

--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      06-10-2008

"Neil Gould" <> wrote in message
news:...
> Hi Earl,
>
> Recently, Earl Partridge <> posted:
>
> > [...] If I switch to CDOSYS, do I need to build in those 6 Const lines?
> > Earl
> >

> I, too, would like to know more about those const lines.
>
> Having just re-written our email routines, I found that including them
> caused the mail to fail. CDOSYS works fine without them. I suspect this is
> an ISP-specific issue, but don't know for sure.


In what way did it fail?

Are you using the identifiers such as cdoSendUsingMethod without defining
them (this is possible in some circumstances)?

OR

Does your original code not manipulate the configuration object at all
(again in some circumstances the ISP can ensure the configuration object is
already set up).




--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
Neil Gould
Guest
Posts: n/a
 
      06-10-2008
Hi Earl,

Recently, Earl Partridge <> posted:

> [...] If I switch to CDOSYS, do I need to build in those 6 Const lines?
> Earl
>

I, too, would like to know more about those const lines.

Having just re-written our email routines, I found that including them
caused the mail to fail. CDOSYS works fine without them. I suspect this is
an ISP-specific issue, but don't know for sure.

Neil



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolve asp CDONTS.NewMail naturebest07@gmail.com Software 0 05-15-2008 07:48 AM
CDONTS NewMail Fatcoin ASP General 2 09-23-2003 06:22 AM
using a comma in the from using CDONTS.NewMail Tom Petersen ASP General 2 09-07-2003 02:25 AM
CDONTS.NewMail - not working...! Steve ASP General 4 08-22-2003 02:07 PM
CDOnts.newmail attachfile don't work right when file is large maher ASP General 0 07-08-2003 04:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57