Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Embed image in CDOSYS message

Reply
Thread Tools

Embed image in CDOSYS message

 
 
Manuel
Guest
Posts: n/a
 
      07-13-2006
Is it possible to embed an image, like a company logo in a CDOSYS generated
message?
If yes, I´ll apreciate some code sample. I´ve been able to format messages
in html the way I like, but I can't figure out how to embed an image.
Thanks for your time.

--
Manuel
 
Reply With Quote
 
 
 
 
James Jones
Guest
Posts: n/a
 
      07-13-2006
well since u kno how to embed HTML, just use the the img tag


connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">



change the connName to ur connection name.
change URL TO IMAGE to the link to ur images u wanna embed.

change height and width as needed. if ur not gonna mess with these
attributes, then just remove them.


note that i have used 2 sets of quoation marks on each side of the value.

"URL TO IMAGE"

will throw you an error, and will not send ur message.


""URL TO IMAGE""


is the correct format.


Hope this helps
Jay







"Manuel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to embed an image, like a company logo in a CDOSYS
> generated
> message?
> If yes, Ill apreciate some code sample. Ive been able to format messages
> in html the way I like, but I can't figure out how to embed an image.
> Thanks for your time.
>
> --
> Manuel



 
Reply With Quote
 
 
 
 
Manuel
Guest
Posts: n/a
 
      07-13-2006
Thanks for your help James. I think we're almos there. What's happening now
is that the message that is sent and I Cc it to myself, comes up in outlook
with that protection asking to right click the image to see it. But when I do
that, nothing happens and the option of the right click to see the image
disappears. Any ideas.
Thanks a million
--
Manuel


"James Jones" wrote:

> well since u kno how to embed HTML, just use the the img tag
>
>
> connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
>
>
>
> change the connName to ur connection name.
> change URL TO IMAGE to the link to ur images u wanna embed.
>
> change height and width as needed. if ur not gonna mess with these
> attributes, then just remove them.
>
>
> note that i have used 2 sets of quoation marks on each side of the value.
>
> "URL TO IMAGE"
>
> will throw you an error, and will not send ur message.
>
>
> ""URL TO IMAGE""
>
>
> is the correct format.
>
>
> Hope this helps
> Jay
>
>
>
>
>
>
>
> "Manuel" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is it possible to embed an image, like a company logo in a CDOSYS
> > generated
> > message?
> > If yes, I´ll apreciate some code sample. I´ve been able to format messages
> > in html the way I like, but I can't figure out how to embed an image.
> > Thanks for your time.
> >
> > --
> > Manuel

>
>
>

 
Reply With Quote
 
James Jones
Guest
Posts: n/a
 
      07-13-2006
mayb the image URL is incorrect...

verify every path is correct everywhere.......make sure u can view images in
outlook as well.




"Manuel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for your help James. I think we're almos there. What's happening
> now
> is that the message that is sent and I Cc it to myself, comes up in
> outlook
> with that protection asking to right click the image to see it. But when I
> do
> that, nothing happens and the option of the right click to see the image
> disappears. Any ideas.
> Thanks a million
> --
> Manuel
>
>
> "James Jones" wrote:
>
>> well since u kno how to embed HTML, just use the the img tag
>>
>>
>> connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX""
>> width=""XX"">
>>
>>
>>
>> change the connName to ur connection name.
>> change URL TO IMAGE to the link to ur images u wanna embed.
>>
>> change height and width as needed. if ur not gonna mess with these
>> attributes, then just remove them.
>>
>>
>> note that i have used 2 sets of quoation marks on each side of the value.
>>
>> "URL TO IMAGE"
>>
>> will throw you an error, and will not send ur message.
>>
>>
>> ""URL TO IMAGE""
>>
>>
>> is the correct format.
>>
>>
>> Hope this helps
>> Jay
>>
>>
>>
>>
>>
>>
>>
>> "Manuel" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Is it possible to embed an image, like a company logo in a CDOSYS
>> > generated
>> > message?
>> > If yes, Ill apreciate some code sample. Ive been able to format
>> > messages
>> > in html the way I like, but I can't figure out how to embed an image.
>> > Thanks for your time.
>> >
>> > --
>> > Manuel

>>
>>
>>



 
Reply With Quote
 
Manuel
Guest
Posts: n/a
 
      07-13-2006
James,
I´m pasting the code that I have now. I hope you bypass the portuguese
language issue.
As you can see, this is a confirmation message of the record insertion in
SQL2000 Server database. I hope this will help you better in your guidance.
Everything works just fine except for the image part as I´ve described in
the previous post.
Thanks again for your pacience.

<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Iterartis_Web_STRING
Recordset1.Source = "SELECT ID, Nome, Cidade, Pais, Email, Telefone,
Telemovel, Nome_Contacto, Data_Prevista, Cidade_Origem, Cidade_Destino,
Descricao_Conteudos FROM dbo.contacto_tbl ORDER BY ID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 1

Dim strNome, strCidade, strPais, strEmail, strTelefone, strTelemovel,
strContacto, strDataPrevista, strCidadeOrigem, strCidadeDestino,
strDescricao, strImage
Dim strBody

strNome = Recordset1("Nome")
strCidade = Recordset1("Cidade")
strPais = Recordset1("Pais")
strEmail = Recordset1("Email")
strTelefone = Recordset1("Telefone")
strTelemovel = Recordset1("Telemovel")
strContacto = Recordset1("Nome_Contacto")
strDataPrevista = Recordset1("Data_Prevista")
strCidadeOrigem = Recordset1("Cidade_Origem")
strCidadeDestino = Recordset1("Cidade_Destino")
strDescricao = Recordset1("Descricao_Conteudos")

strBody = strBody & "<img src=""/images/Logo.gif""/>" & "<br>" & "<br>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Formulário que nos foi enviado na
Data/Hora:</font></strong></td>" & "<font face=""Verdana"" size=""1""
color=""#000000"">"& " " & Now() & vbCrLf & "<br><br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">From:</font></strong>" & "<font face=""Verdana"" size=""1""
color=""#000000"">&nbsp;http://" & Request.ServerVariables("HTTP_HOST") &
vbCrLf & "<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">IP:</font></strong> " & "<font face=""Verdana"" size=""1""
color=""#000000"">" & " " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf &
"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Nome:</font></strong>" & "<font face=""Verdana"" size=""1""
color=""#000000"">" & " " & strNome &"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Cidade:</font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strCidade &"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Pa*s:</font></strong>" & "<font face=""Verdana"" size=""1""
color=""#000000"">" & " " & strPais &"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Email:</font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strEmail &"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Telefone:</font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strTelefone &"<br>" & "<br>" &
"</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Telemóvel:</font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strTelemovel &"<br>" & "<br>" &
"</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Nome do Contacto:</font></strong>" & "<font
face=""Verdana"" size=""1"" color=""#000000"">" & " " & strContacto &"<br>" &
"<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Data Prevista:</font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strDataPrevista &"<br>" & "<br>" &
"</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Cidade de Origem:</font></strong>" & "<font
face=""Verdana"" size=""1"" color=""#000000"">" & " " & strCidadeOrigem
&"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Cidade de Destino:</font></strong>" & "<font
face=""Verdana"" size=""1"" color=""#000000"">" & " " & strCidadeDestino
&"<br>" & "<br>" & "</font>"

strBody = strBody & "<strong><font face=""Verdana"" size=""1""
color=""#DC241F"">Conteúdos:<br></font></strong>" & "<font face=""Verdana""
size=""1"" color=""#000000"">" & " " & strDescricao &"<br>" & "<br>"

strBody = strBody & "</font>"

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")

ObjSendMail.To = strEmail
ObjSendMail.Bcc = "(E-Mail Removed)"
ObjSendMail.Subject = "Confirmação de Pedido de Orçamento"
ObjSendMail.From = "(E-Mail Removed)"

' we are sending a html email.. simply switch the comments around to send a
text email instead
ObjSendMail.HTMLBody = strBody
'ObjSendMail.TextBody = strBody

ObjSendMail.Send

Set ObjSendMail = Nothing

%>


--
Manuel


"James Jones" wrote:

> well since u kno how to embed HTML, just use the the img tag
>
>
> connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
>
>
>
> change the connName to ur connection name.
> change URL TO IMAGE to the link to ur images u wanna embed.
>
> change height and width as needed. if ur not gonna mess with these
> attributes, then just remove them.
>
>
> note that i have used 2 sets of quoation marks on each side of the value.
>
> "URL TO IMAGE"
>
> will throw you an error, and will not send ur message.
>
>
> ""URL TO IMAGE""
>
>
> is the correct format.
>
>
> Hope this helps
> Jay
>
>
>
>
>
>
>
> "Manuel" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is it possible to embed an image, like a company logo in a CDOSYS
> > generated
> > message?
> > If yes, I´ll apreciate some code sample. I´ve been able to format messages
> > in html the way I like, but I can't figure out how to embed an image.
> > Thanks for your time.
> >
> > --
> > Manuel

>
>
>

 
Reply With Quote
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      07-13-2006

"Manuel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to embed an image, like a company logo in a CDOSYS
> generated
> message?
> If yes, I´ll apreciate some code sample. I´ve been able to format messages
> in html the way I like, but I can't figure out how to embed an image.
> Thanks for your time.


What you'd do best, is generate an email thorugh outlook or other program,
where the emails are embedded.
Sample. Use IE6 to save a website to a single page!
Then look at the contents of the page, it will be MIME 1.0 part encoded.

The MSDN has some samples.

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      07-13-2006
You need to host the image on a publicly accessible web server and
provide the full url in the src attribute:

<img src=""http://www.domain.pt/images/image.gif"">

Incidentally, all that string concatentation is terribly wasteful.
Each time you write strBody = strBody &, the ASP engine has to recreate
the string from scratch, as well as hold the current value of strBody
in memory. When I design an html email, I create it in Dreamweaver (or
some other WYSIWYG editor) then take the resulting html source, pop it
into word and run a tiny macro I created to double up on double quotes
and remove paragraphs. That gives me one long unbroken string.

Or you can use the underscore character:

strBody = "some text" & _
"some more text" & _
"even more text"

--
Mike Brind

Manuel wrote:
> James,
> Im pasting the code that I have now. I hope you bypass the portuguese
> language issue.
> As you can see, this is a confirmation message of the record insertion in
> SQL2000 Server database. I hope this will help you better in your guidance.
> Everything works just fine except for the image part as Ive described in
> the previous post.
> Thanks again for your pacience.
>
> <%
> Dim Recordset1
> Dim Recordset1_numRows
>
> Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> Recordset1.ActiveConnection = MM_Iterartis_Web_STRING
> Recordset1.Source = "SELECT ID, Nome, Cidade, Pais, Email, Telefone,
> Telemovel, Nome_Contacto, Data_Prevista, Cidade_Origem, Cidade_Destino,
> Descricao_Conteudos FROM dbo.contacto_tbl ORDER BY ID DESC"
> Recordset1.CursorType = 0
> Recordset1.CursorLocation = 2
> Recordset1.LockType = 1
> Recordset1.Open()
>
> Recordset1_numRows = 1
>
> Dim strNome, strCidade, strPais, strEmail, strTelefone, strTelemovel,
> strContacto, strDataPrevista, strCidadeOrigem, strCidadeDestino,
> strDescricao, strImage
> Dim strBody
>
> strNome = Recordset1("Nome")
> strCidade = Recordset1("Cidade")
> strPais = Recordset1("Pais")
> strEmail = Recordset1("Email")
> strTelefone = Recordset1("Telefone")
> strTelemovel = Recordset1("Telemovel")
> strContacto = Recordset1("Nome_Contacto")
> strDataPrevista = Recordset1("Data_Prevista")
> strCidadeOrigem = Recordset1("Cidade_Origem")
> strCidadeDestino = Recordset1("Cidade_Destino")
> strDescricao = Recordset1("Descricao_Conteudos")
>
> strBody = strBody & "<img src=""/images/Logo.gif""/>" & "<br>" & "<br>"
>

[snipped]

> Dim ObjSendMail
> Set ObjSendMail = CreateObject("CDO.Message")
>
> ObjSendMail.To = strEmail
> ObjSendMail.Bcc = "(E-Mail Removed)"
> ObjSendMail.Subject = "Confirmao de Pedido de Oramento"
> ObjSendMail.From = "(E-Mail Removed)"
>
> ' we are sending a html email.. simply switch the comments around to senda
> text email instead
> ObjSendMail.HTMLBody = strBody
> 'ObjSendMail.TextBody = strBody
>
> ObjSendMail.Send
>
> Set ObjSendMail = Nothing
>
> %>
>
>
> --
> Manuel
>
>
> "James Jones" wrote:
>
> > well since u kno how to embed HTML, just use the the img tag
> >
> >
> > connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
> >
> >
> >
> > change the connName to ur connection name.
> > change URL TO IMAGE to the link to ur images u wanna embed.
> >
> > change height and width as needed. if ur not gonna mess with these
> > attributes, then just remove them.
> >
> >
> > note that i have used 2 sets of quoation marks on each side of the value.
> >
> > "URL TO IMAGE"
> >
> > will throw you an error, and will not send ur message.
> >
> >
> > ""URL TO IMAGE""
> >
> >
> > is the correct format.
> >
> >
> > Hope this helps
> > Jay
> >
> >
> >
> >
> >
> >
> >
> > "Manuel" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Is it possible to embed an image, like a company logo in a CDOSYS
> > > generated
> > > message?
> > > If yes, Ill apreciate some code sample. Ive been able to formatmessages
> > > in html the way I like, but I can't figure out how to embed an image.
> > > Thanks for your time.
> > >
> > > --
> > > Manuel

> >
> >
> >


 
Reply With Quote
 
Manuel
Guest
Posts: n/a
 
      07-13-2006
Thank you Mike.

I´ll make it one string immediatelly. Thanks for the advice. As for having to
be on a publicly accessible web server and provide the full url in the src
attribute, could I not have my server for testing purposes do the job and
instead of the
<img src=""http://www.domain.pt/images/image.gif""> have
<img src=""http://myIP/images/image.gif"">
To browse the website I´m developing it works. But I´ve tried that and it
didn't work. If it's not suppose to work, could you explain why? Thanks for
your pacience and thanks for the pt in the domain.
That was a kind note.
--
Manuel


"Mike Brind" wrote:

> You need to host the image on a publicly accessible web server and
> provide the full url in the src attribute:
>
> <img src=""http://www.domain.pt/images/image.gif"">
>
> Incidentally, all that string concatentation is terribly wasteful.
> Each time you write strBody = strBody &, the ASP engine has to recreate
> the string from scratch, as well as hold the current value of strBody
> in memory. When I design an html email, I create it in Dreamweaver (or
> some other WYSIWYG editor) then take the resulting html source, pop it
> into word and run a tiny macro I created to double up on double quotes
> and remove paragraphs. That gives me one long unbroken string.
>
> Or you can use the underscore character:
>
> strBody = "some text" & _
> "some more text" & _
> "even more text"
>
> --
> Mike Brind
>
> Manuel wrote:
> > James,
> > I´m pasting the code that I have now. I hope you bypass the portuguese
> > language issue.
> > As you can see, this is a confirmation message of the record insertion in
> > SQL2000 Server database. I hope this will help you better in your guidance.
> > Everything works just fine except for the image part as I´ve described in
> > the previous post.
> > Thanks again for your pacience.
> >
> > <%
> > Dim Recordset1
> > Dim Recordset1_numRows
> >
> > Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> > Recordset1.ActiveConnection = MM_Iterartis_Web_STRING
> > Recordset1.Source = "SELECT ID, Nome, Cidade, Pais, Email, Telefone,
> > Telemovel, Nome_Contacto, Data_Prevista, Cidade_Origem, Cidade_Destino,
> > Descricao_Conteudos FROM dbo.contacto_tbl ORDER BY ID DESC"
> > Recordset1.CursorType = 0
> > Recordset1.CursorLocation = 2
> > Recordset1.LockType = 1
> > Recordset1.Open()
> >
> > Recordset1_numRows = 1
> >
> > Dim strNome, strCidade, strPais, strEmail, strTelefone, strTelemovel,
> > strContacto, strDataPrevista, strCidadeOrigem, strCidadeDestino,
> > strDescricao, strImage
> > Dim strBody
> >
> > strNome = Recordset1("Nome")
> > strCidade = Recordset1("Cidade")
> > strPais = Recordset1("Pais")
> > strEmail = Recordset1("Email")
> > strTelefone = Recordset1("Telefone")
> > strTelemovel = Recordset1("Telemovel")
> > strContacto = Recordset1("Nome_Contacto")
> > strDataPrevista = Recordset1("Data_Prevista")
> > strCidadeOrigem = Recordset1("Cidade_Origem")
> > strCidadeDestino = Recordset1("Cidade_Destino")
> > strDescricao = Recordset1("Descricao_Conteudos")
> >
> > strBody = strBody & "<img src=""/images/Logo.gif""/>" & "<br>" & "<br>"
> >

> [snipped]
>
> > Dim ObjSendMail
> > Set ObjSendMail = CreateObject("CDO.Message")
> >
> > ObjSendMail.To = strEmail
> > ObjSendMail.Bcc = "(E-Mail Removed)"
> > ObjSendMail.Subject = "Confirmação de Pedido de Orçamento"
> > ObjSendMail.From = "(E-Mail Removed)"
> >
> > ' we are sending a html email.. simply switch the comments around to send a
> > text email instead
> > ObjSendMail.HTMLBody = strBody
> > 'ObjSendMail.TextBody = strBody
> >
> > ObjSendMail.Send
> >
> > Set ObjSendMail = Nothing
> >
> > %>
> >
> >
> > --
> > Manuel
> >
> >
> > "James Jones" wrote:
> >
> > > well since u kno how to embed HTML, just use the the img tag
> > >
> > >
> > > connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
> > >
> > >
> > >
> > > change the connName to ur connection name.
> > > change URL TO IMAGE to the link to ur images u wanna embed.
> > >
> > > change height and width as needed. if ur not gonna mess with these
> > > attributes, then just remove them.
> > >
> > >
> > > note that i have used 2 sets of quoation marks on each side of the value.
> > >
> > > "URL TO IMAGE"
> > >
> > > will throw you an error, and will not send ur message.
> > >
> > >
> > > ""URL TO IMAGE""
> > >
> > >
> > > is the correct format.
> > >
> > >
> > > Hope this helps
> > > Jay
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Manuel" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Is it possible to embed an image, like a company logo in a CDOSYS
> > > > generated
> > > > message?
> > > > If yes, I´ll apreciate some code sample. I´ve been able to format messages
> > > > in html the way I like, but I can't figure out how to embed an image.
> > > > Thanks for your time.
> > > >
> > > > --
> > > > Manuel
> > >
> > >
> > >

>
>

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      07-13-2006
For testing purposes, of course you can replace the domain with an IP.
In fact, there's no reason why you can't retain the IP address and keep
the image there for the real thing. So long as the URL is the correct
one, I see no reason why it shouldn't work properly, unless your ISP
has some rules preventing remote hosting of images.

The pt domain? Thought you'd like that

--
Mike Brind

Manuel wrote:
> Thank you Mike.
>
> Ill make it one string immediatelly. Thanks for the advice. As for having to
> be on a publicly accessible web server and provide the full url in the src
> attribute, could I not have my server for testing purposes do the job and
> instead of the
> <img src=""http://www.domain.pt/images/image.gif""> have
> <img src=""http://myIP/images/image.gif"">
> To browse the website Im developing it works. But Ive tried that and it
> didn't work. If it's not suppose to work, could you explain why? Thanks for
> your pacience and thanks for the pt in the domain.
> That was a kind note.
> --
> Manuel
>
>
> "Mike Brind" wrote:
>
> > You need to host the image on a publicly accessible web server and
> > provide the full url in the src attribute:
> >
> > <img src=""http://www.domain.pt/images/image.gif"">
> >
> > Incidentally, all that string concatentation is terribly wasteful.
> > Each time you write strBody = strBody &, the ASP engine has to recreate
> > the string from scratch, as well as hold the current value of strBody
> > in memory. When I design an html email, I create it in Dreamweaver (or
> > some other WYSIWYG editor) then take the resulting html source, pop it
> > into word and run a tiny macro I created to double up on double quotes
> > and remove paragraphs. That gives me one long unbroken string.
> >
> > Or you can use the underscore character:
> >
> > strBody = "some text" & _
> > "some more text" & _
> > "even more text"
> >
> > --
> > Mike Brind
> >
> > Manuel wrote:
> > > James,
> > > Im pasting the code that I have now. I hope you bypass the portuguese
> > > language issue.
> > > As you can see, this is a confirmation message of the record insertion in
> > > SQL2000 Server database. I hope this will help you better in your guidance.
> > > Everything works just fine except for the image part as Ive described in
> > > the previous post.
> > > Thanks again for your pacience.
> > >
> > > <%
> > > Dim Recordset1
> > > Dim Recordset1_numRows
> > >
> > > Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> > > Recordset1.ActiveConnection = MM_Iterartis_Web_STRING
> > > Recordset1.Source = "SELECT ID, Nome, Cidade, Pais, Email, Telefone,
> > > Telemovel, Nome_Contacto, Data_Prevista, Cidade_Origem, Cidade_Destino,
> > > Descricao_Conteudos FROM dbo.contacto_tbl ORDER BY ID DESC"
> > > Recordset1.CursorType = 0
> > > Recordset1.CursorLocation = 2
> > > Recordset1.LockType = 1
> > > Recordset1.Open()
> > >
> > > Recordset1_numRows = 1
> > >
> > > Dim strNome, strCidade, strPais, strEmail, strTelefone, strTelemovel,
> > > strContacto, strDataPrevista, strCidadeOrigem, strCidadeDestino,
> > > strDescricao, strImage
> > > Dim strBody
> > >
> > > strNome = Recordset1("Nome")
> > > strCidade = Recordset1("Cidade")
> > > strPais = Recordset1("Pais")
> > > strEmail = Recordset1("Email")
> > > strTelefone = Recordset1("Telefone")
> > > strTelemovel = Recordset1("Telemovel")
> > > strContacto = Recordset1("Nome_Contacto")
> > > strDataPrevista = Recordset1("Data_Prevista")
> > > strCidadeOrigem = Recordset1("Cidade_Origem")
> > > strCidadeDestino = Recordset1("Cidade_Destino")
> > > strDescricao = Recordset1("Descricao_Conteudos")
> > >
> > > strBody = strBody & "<img src=""/images/Logo.gif""/>" & "<br>" & "<br>"
> > >

> > [snipped]
> >
> > > Dim ObjSendMail
> > > Set ObjSendMail = CreateObject("CDO.Message")
> > >
> > > ObjSendMail.To = strEmail
> > > ObjSendMail.Bcc = "(E-Mail Removed)"
> > > ObjSendMail.Subject = "Confirmao de Pedido de Oramento"
> > > ObjSendMail.From = "(E-Mail Removed)"
> > >
> > > ' we are sending a html email.. simply switch the comments around to send a
> > > text email instead
> > > ObjSendMail.HTMLBody = strBody
> > > 'ObjSendMail.TextBody = strBody
> > >
> > > ObjSendMail.Send
> > >
> > > Set ObjSendMail = Nothing
> > >
> > > %>
> > >
> > >
> > > --
> > > Manuel
> > >
> > >
> > > "James Jones" wrote:
> > >
> > > > well since u kno how to embed HTML, just use the the img tag
> > > >
> > > >
> > > > connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
> > > >
> > > >
> > > >
> > > > change the connName to ur connection name.
> > > > change URL TO IMAGE to the link to ur images u wanna embed.
> > > >
> > > > change height and width as needed. if ur not gonna mess with these
> > > > attributes, then just remove them.
> > > >
> > > >
> > > > note that i have used 2 sets of quoation marks on each side of the value.
> > > >
> > > > "URL TO IMAGE"
> > > >
> > > > will throw you an error, and will not send ur message.
> > > >
> > > >
> > > > ""URL TO IMAGE""
> > > >
> > > >
> > > > is the correct format.
> > > >
> > > >
> > > > Hope this helps
> > > > Jay
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "Manuel" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > Is it possible to embed an image, like a company logo in a CDOSYS
> > > > > generated
> > > > > message?
> > > > > If yes, Ill apreciate some code sample. Ive been able to format messages
> > > > > in html the way I like, but I can't figure out how to embed an image.
> > > > > Thanks for your time.
> > > > >
> > > > > --
> > > > > Manuel
> > > >
> > > >
> > > >

> >
> >


 
Reply With Quote
 
Manuel
Guest
Posts: n/a
 
      07-13-2006
Correction Mike:

It works beautifully. I had a wrong statement. Everything is already in one
string. Thanks once more for the lesson.
--
Manuel


"Mike Brind" wrote:

> You need to host the image on a publicly accessible web server and
> provide the full url in the src attribute:
>
> <img src=""http://www.domain.pt/images/image.gif"">
>
> Incidentally, all that string concatentation is terribly wasteful.
> Each time you write strBody = strBody &, the ASP engine has to recreate
> the string from scratch, as well as hold the current value of strBody
> in memory. When I design an html email, I create it in Dreamweaver (or
> some other WYSIWYG editor) then take the resulting html source, pop it
> into word and run a tiny macro I created to double up on double quotes
> and remove paragraphs. That gives me one long unbroken string.
>
> Or you can use the underscore character:
>
> strBody = "some text" & _
> "some more text" & _
> "even more text"
>
> --
> Mike Brind
>
> Manuel wrote:
> > James,
> > I´m pasting the code that I have now. I hope you bypass the portuguese
> > language issue.
> > As you can see, this is a confirmation message of the record insertion in
> > SQL2000 Server database. I hope this will help you better in your guidance.
> > Everything works just fine except for the image part as I´ve described in
> > the previous post.
> > Thanks again for your pacience.
> >
> > <%
> > Dim Recordset1
> > Dim Recordset1_numRows
> >
> > Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> > Recordset1.ActiveConnection = MM_Iterartis_Web_STRING
> > Recordset1.Source = "SELECT ID, Nome, Cidade, Pais, Email, Telefone,
> > Telemovel, Nome_Contacto, Data_Prevista, Cidade_Origem, Cidade_Destino,
> > Descricao_Conteudos FROM dbo.contacto_tbl ORDER BY ID DESC"
> > Recordset1.CursorType = 0
> > Recordset1.CursorLocation = 2
> > Recordset1.LockType = 1
> > Recordset1.Open()
> >
> > Recordset1_numRows = 1
> >
> > Dim strNome, strCidade, strPais, strEmail, strTelefone, strTelemovel,
> > strContacto, strDataPrevista, strCidadeOrigem, strCidadeDestino,
> > strDescricao, strImage
> > Dim strBody
> >
> > strNome = Recordset1("Nome")
> > strCidade = Recordset1("Cidade")
> > strPais = Recordset1("Pais")
> > strEmail = Recordset1("Email")
> > strTelefone = Recordset1("Telefone")
> > strTelemovel = Recordset1("Telemovel")
> > strContacto = Recordset1("Nome_Contacto")
> > strDataPrevista = Recordset1("Data_Prevista")
> > strCidadeOrigem = Recordset1("Cidade_Origem")
> > strCidadeDestino = Recordset1("Cidade_Destino")
> > strDescricao = Recordset1("Descricao_Conteudos")
> >
> > strBody = strBody & "<img src=""/images/Logo.gif""/>" & "<br>" & "<br>"
> >

> [snipped]
>
> > Dim ObjSendMail
> > Set ObjSendMail = CreateObject("CDO.Message")
> >
> > ObjSendMail.To = strEmail
> > ObjSendMail.Bcc = "(E-Mail Removed)"
> > ObjSendMail.Subject = "Confirmação de Pedido de Orçamento"
> > ObjSendMail.From = "(E-Mail Removed)"
> >
> > ' we are sending a html email.. simply switch the comments around to send a
> > text email instead
> > ObjSendMail.HTMLBody = strBody
> > 'ObjSendMail.TextBody = strBody
> >
> > ObjSendMail.Send
> >
> > Set ObjSendMail = Nothing
> >
> > %>
> >
> >
> > --
> > Manuel
> >
> >
> > "James Jones" wrote:
> >
> > > well since u kno how to embed HTML, just use the the img tag
> > >
> > >
> > > connName.HTMLBody = "<img src=""URL TO IMAGE"" height=""XX"" width=""XX"">
> > >
> > >
> > >
> > > change the connName to ur connection name.
> > > change URL TO IMAGE to the link to ur images u wanna embed.
> > >
> > > change height and width as needed. if ur not gonna mess with these
> > > attributes, then just remove them.
> > >
> > >
> > > note that i have used 2 sets of quoation marks on each side of the value.
> > >
> > > "URL TO IMAGE"
> > >
> > > will throw you an error, and will not send ur message.
> > >
> > >
> > > ""URL TO IMAGE""
> > >
> > >
> > > is the correct format.
> > >
> > >
> > > Hope this helps
> > > Jay
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Manuel" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Is it possible to embed an image, like a company logo in a CDOSYS
> > > > generated
> > > > message?
> > > > If yes, I´ll apreciate some code sample. I´ve been able to format messages
> > > > in html the way I like, but I can't figure out how to embed an image.
> > > > Thanks for your time.
> > > >
> > > > --
> > > > Manuel
> > >
> > >
> > >

>
>

 
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
cdosys.dll and sending mail martin ASP .Net 2 01-04-2012 02:41 PM
Re: Get nasty security message using EMBED in html Mike Duffy HTML 4 04-12-2009 02:18 AM
Get nasty security message using EMBED in html Angus Javascript 1 03-31-2009 12:59 AM
Setting message priority with CDOSYS Peter Croft ASP General 6 07-22-2004 06:34 AM
embed pictures in a cdosys sent message Ren de Leeuw ASP .Net 0 07-22-2003 04:07 PM



Advertisments