Showing posts with label emails. Show all posts
Showing posts with label emails. Show all posts

Monday, March 26, 2012

Html formatted email

Can anyone advise me on how to amend the following code to send Html formatted emails? It works perfectly in normal text format - I am a novice programmer.

<%@dotnet.itags.org.PageExplicit="true"Language="VB"Debug="True" %>

<html>

<head>

</head>

<body>

<%

Dim EMailFromAsString = Session("eMailFrom")

Dim EMailToAsString = Request.Form("txtTo")

Dim EMailSubjectAsString ="Your Report"

Dim EMailBodyAsString = Request.Form("txtNewBody")

Dim MySmtpClientAsNew System.Net.Mail.SmtpClient

MySmtpClient.Send(EMailFrom, EMailTo, EMailSubject, EMailBody)%>

Any help appreciated

Anything and everything email and .NET related can be found at:

If you are dealing with 1.1:
http://www.systemwebmail.com

Or 2.0 framework
http://www.systemnetmail.com

Both sites have working examples, diagnostic solutions, and setup


I put together a FAQ in the FAQ Forum:HOW TO: Send using System.Net.Mail

HTH,
Ryan

Saturday, March 24, 2012

html email with embedded images

Hi,
I know how to send emails from the .Net environment, even html mails.
But, what is the best way to add images to the html?
A URL to an image somewhere on some server is usually blocked nowadays,
so you need to send the image as attachment. I had some success when I
used the filename (without path) of the attachment as img-src.
Is that the only way or are there better methods?
A related question: some of these images might be stored in the database
or generated "on the fly", but the MailAttachment class uses filenames.
Is there any way to attach some document *without* storing it first?
If not, can I safely delete that temporary file directly after I send the
email to the server?
Hans KestingI don't believe you can embed images into an email with the .net mail.
I also have to send out email's with embedded images that came from a
database. I basically had to write my own SMTP client to replace the built
in .net version. You can also purchase a 3rd party package that will do
this. (I couldn't since our product is resold and it would cause licencing
issues)
Unfortunally I can't send my code...they would probably fire me! But I can
offer you a few pointers on what you should do. Writing you're own SMTP
client isn't as easy as it sounds...there's a lot of standards to follow.
I strongly recommend that you use a 3rd party package...maybe this:
http://www.quiksoft.com/emdotnet/comparison.asp
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message
news:OZp%23JhRsEHA.160@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I know how to send emails from the .Net environment, even html mails.
> But, what is the best way to add images to the html?
> A URL to an image somewhere on some server is usually blocked nowadays,
> so you need to send the image as attachment. I had some success when I
> used the filename (without path) of the attachment as img-src.
> Is that the only way or are there better methods?
> A related question: some of these images might be stored in the database
> or generated "on the fly", but the MailAttachment class uses filenames.
> Is there any way to attach some document *without* storing it first?
> If not, can I safely delete that temporary file directly after I send the
> email to the server?
> Hans Kesting
>

html email with embedded images

Hi,

I know how to send emails from the .Net environment, even html mails.
But, what is the best way to add images to the html?

A URL to an image somewhere on some server is usually blocked nowadays,
so you need to send the image as attachment. I had some success when I
used the filename (without path) of the attachment as img-src.
Is that the only way or are there better methods?

A related question: some of these images might be stored in the database
or generated "on the fly", but the MailAttachment class uses filenames.
Is there any way to attach some document *without* storing it first?
If not, can I safely delete that temporary file directly after I send the
email to the server?

Hans KestingI don't believe you can embed images into an email with the .net mail.

I also have to send out email's with embedded images that came from a
database. I basically had to write my own SMTP client to replace the built
in .net version. You can also purchase a 3rd party package that will do
this. (I couldn't since our product is resold and it would cause licencing
issues)

Unfortunally I can't send my code...they would probably fire me! But I can
offer you a few pointers on what you should do. Writing you're own SMTP
client isn't as easy as it sounds...there's a lot of standards to follow.
I strongly recommend that you use a 3rd party package...maybe this:
http://www.quiksoft.com/emdotnet/comparison.asp

"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message
news:OZp%23JhRsEHA.160@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I know how to send emails from the .Net environment, even html mails.
> But, what is the best way to add images to the html?
> A URL to an image somewhere on some server is usually blocked nowadays,
> so you need to send the image as attachment. I had some success when I
> used the filename (without path) of the attachment as img-src.
> Is that the only way or are there better methods?
> A related question: some of these images might be stored in the database
> or generated "on the fly", but the MailAttachment class uses filenames.
> Is there any way to attach some document *without* storing it first?
> If not, can I safely delete that temporary file directly after I send the
> email to the server?
> Hans Kesting