Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = "justme@myaddress.com"
MyMail.To = "friend1@address1.com;friend2@address2.com"
MyMail.Subject = "Sending Mail via CDOSYS for Windows 2000/XP"
MyMail.TextBody = "Sending email with CDOSYS Message " &_
"objects is easy! Try it!"
MyMail.AddAttachment "c:\path\smiley.gif"
MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing

If the "smiley.gif" is in the database(e.g. sql server),how to do it?

Re: send a mail include an attachment with CDO, if the attachment is in the DataBase, How to do it? by Steven

Steven
Tue Apr 05 08:51:00 CDT 2005

Not ideal but........write it to a temporary file > send it > delete it

--=20
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"eren" <eren@email.com> wrote in message =
news:OlGhOYeOFHA.3808@TK2MSFTNGP14.phx.gbl...
> Dim MyMail
> Set MyMail =3D Server.CreateObject("CDO.Message")
> MyMail.From =3D "justme@myaddress.com"
> MyMail.To =3D "friend1@address1.com;friend2@address2.com"
> MyMail.Subject =3D "Sending Mail via CDOSYS for Windows 2000/XP"
> MyMail.TextBody =3D "Sending email with CDOSYS Message " &_
> "objects is easy! Try it!"
> MyMail.AddAttachment "c:\path\smiley.gif"
> MyMail.Fields("urn:schemas:httpmail:importance").Value =3D 2;
> MyMail.Fields.Update()
> MyMail.Send()
> Set MyMail =3D Nothing
>=20
> If the "smiley.gif" is in the database(e.g. sql server),how to do it?
>=20
>=20


Re: send a mail include an attachment with CDO, if the attachment is in the DataBase, How to do it? by eren

eren
Tue Apr 05 09:12:38 CDT 2005

thank you...
I have thought about this way, but I think it isn't professional.:)

Best Regrads
eren

"Steven Burn" <somewhere@in-time.invalid> wrote in message
news:%23MERnaeOFHA.3828@TK2MSFTNGP10.phx.gbl...
Not ideal but........write it to a temporary file > send it > delete it

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"eren" <eren@email.com> wrote in message
news:OlGhOYeOFHA.3808@TK2MSFTNGP14.phx.gbl...
> Dim MyMail
> Set MyMail = Server.CreateObject("CDO.Message")
> MyMail.From = "justme@myaddress.com"
> MyMail.To = "friend1@address1.com;friend2@address2.com"
> MyMail.Subject = "Sending Mail via CDOSYS for Windows 2000/XP"
> MyMail.TextBody = "Sending email with CDOSYS Message " &_
> "objects is easy! Try it!"
> MyMail.AddAttachment "c:\path\smiley.gif"
> MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
> MyMail.Fields.Update()
> MyMail.Send()
> Set MyMail = Nothing
>
> If the "smiley.gif" is in the database(e.g. sql server),how to do it?
>
>



Re: send a mail include an attachment with CDO, if the attachment is in the DataBase, How to do it? by Michael

Michael
Wed Apr 06 08:25:41 CDT 2005

eren wrote:
> Dim MyMail
> Set MyMail = Server.CreateObject("CDO.Message")
> MyMail.From = "justme@myaddress.com"
> MyMail.To = "friend1@address1.com;friend2@address2.com"
> MyMail.Subject = "Sending Mail via CDOSYS for Windows 2000/XP"
> MyMail.TextBody = "Sending email with CDOSYS Message " &_
> "objects is easy! Try it!"
> MyMail.AddAttachment "c:\path\smiley.gif"
> MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
> MyMail.Fields.Update()
> MyMail.Send()
> Set MyMail = Nothing
>
> If the "smiley.gif" is in the database(e.g. sql server),how to do it?



Manually Adding Attachments
http://msdn.microsoft.com/library/en-us/e2k3/e2k3/_cdo_manually_adding_attachments.asp



--
Michael Harris
Microsoft.MVP.Scripting


Re: send a mail include an attachment with CDO, if the attachment is in the DataBase, How to do it? by eren

eren
Fri Apr 08 10:00:48 CDT 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0012_01C53C8E.CDA2AC60
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

hello sir,
Thank you very very much.
The above problem are solved so far,but there is other questions =
come,please refer to below:
.Item("urn:schemas:mailheader:content-type")=20
if there are most types such as file, .doc, .exe, .rar ....and so =
on,which kind of content-type should be used to set?
Now it seems that this setting" application/msword" are available for =
any types mentioned above,I don't know why?
Would you please so kind to show me that how many types can be set for =
the content-type,and explain them to me detailed? =20
Wait for your reply.
Thanks in advance!
Br.
eren

"Michael Harris (MVP)" <mikhar@mvps.org> wrote in message =
news:ucUViwqOFHA.3512@TK2MSFTNGP15.phx.gbl...
> eren wrote:
> > Dim MyMail
> > Set MyMail =3D Server.CreateObject("CDO.Message")
> > MyMail.From =3D "justme@myaddress.com"
> > MyMail.To =3D "friend1@address1.com;friend2@address2.com"
> > MyMail.Subject =3D "Sending Mail via CDOSYS for Windows 2000/XP"
> > MyMail.TextBody =3D "Sending email with CDOSYS Message " &_
> > "objects is easy! Try it!"
> > MyMail.AddAttachment "c:\path\smiley.gif"
> > MyMail.Fields("urn:schemas:httpmail:importance").Value =3D 2;
> > MyMail.Fields.Update()
> > MyMail.Send()
> > Set MyMail =3D Nothing
> >
> > If the "smiley.gif" is in the database(e.g. sql server),how to do =
it?
>=20
>=20
>=20
> Manually Adding Attachments
> =
http://msdn.microsoft.com/library/en-us/e2k3/e2k3/_cdo_manually_adding_at=
tachments.asp
>=20
>=20
>=20
> --=20
> Michael Harris
> Microsoft.MVP.Scripting
>
------=_NextPart_000_0012_01C53C8E.CDA2AC60
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>hello sir,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very very much.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The above problem are solved so far,but =
there is=20
other questions come,please refer to below:</FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff=20
size=3D2>.Item("urn:schemas:mailheader:content-type")&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>if&nbsp;there are&nbsp;most types such =
as file,=20
.doc, .exe, .rar ....and so on,which kind of =
content-type&nbsp;&nbsp;should be=20
used to&nbsp;set?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now it seems that&nbsp;this =
setting"&nbsp;<SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">application/msword"&nbsp;are=20
available for any &nbsp;types mentioned above,I don't know=20
why?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">&nbsp;<FONT=20
face=3DArial size=3D2>Would you please so kind to show me that <FONT=20
color=3D#0000ff><FONT color=3D#000000>how many types can be set for =
the</FONT>=20
content-type,</FONT><FONT color=3D#000000>and explain them to me=20
detailed?&nbsp;&nbsp;</FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">Wait=20
for your reply.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">Thanks=20
in advance!</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">Br.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA">eren</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#23435;&#20307;; =
mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: =
ZH-CN; mso-bidi-language: AR-SA"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Michael Harris (MVP)" &lt;</FONT><A=20
href=3D"mailto:mikhar@mvps.org"><FONT face=3DArial=20
size=3D2>mikhar@mvps.org</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in message=20
</FONT><A href=3D"news:ucUViwqOFHA.3512@TK2MSFTNGP15.phx.gbl"><FONT =
face=3DArial=20
size=3D2>news:ucUViwqOFHA.3512@TK2MSFTNGP15.phx.gbl</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; eren =
wrote:<BR>&gt; &gt; Dim=20
MyMail<BR>&gt; &gt; Set MyMail =3D =
Server.CreateObject("CDO.Message")<BR>&gt; &gt;=20
MyMail.From =3D "</FONT><A href=3D"mailto:justme@myaddress.com"><FONT =
face=3DArial=20
size=3D2>justme@myaddress.com</FONT></A><FONT face=3DArial =
size=3D2>"<BR>&gt; &gt;=20
MyMail.To =3D "</FONT><A=20
href=3D"mailto:friend1@address1.com;friend2@address2.com"><FONT =
face=3DArial=20
size=3D2>friend1@address1.com;friend2@address2.com</FONT></A><FONT =
face=3DArial=20
size=3D2>"<BR>&gt; &gt; MyMail.Subject =3D "Sending Mail via CDOSYS for =
Windows=20
2000/XP"<BR>&gt; &gt; MyMail.TextBody =3D "Sending email with CDOSYS =
Message "=20
&amp;_<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "objects is =
easy! Try=20
it!"<BR>&gt; &gt; MyMail.AddAttachment "c:\path\smiley.gif"<BR>&gt; &gt; =

MyMail.Fields("urn:schemas:httpmail:importance").Value =3D 2;<BR>&gt; =
&gt;=20
MyMail.Fields.Update()<BR>&gt; &gt; MyMail.Send()<BR>&gt; &gt; Set =
MyMail =3D=20
Nothing<BR>&gt; &gt;<BR>&gt; &gt; If the "smiley.gif" is in the =
database(e.g.=20
sql server),how to do it?<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Manually =
Adding=20
Attachments<BR>&gt; </FONT><A=20
href=3D"http://msdn.microsoft.com/library/en-us/e2k3/e2k3/_cdo_manually_a=
dding_attachments.asp"><FONT=20
face=3DArial=20
size=3D2>http://msdn.microsoft.com/library/en-us/e2k3/e2k3/_cdo_manually_=
adding_attachments.asp</FONT></A><BR><FONT=20
face=3DArial size=3D2>&gt; <BR>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; =
Michael=20
Harris<BR>&gt; Microsoft.MVP.Scripting<BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0012_01C53C8E.CDA2AC60--