470,819 Members | 1,568 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,819 developers. It's quick & easy.

automatic email notification of online form submission

I have a database application that is submitted to an Access database. What
I want is when the form is submitted to automatically send an email to
multiple persons with the info from the form. This could be as an
attachement or plain text. I wouldn't care if it was like the mailto. I'm
clueless on how to do this.
Any help would be greatly appreciated.
Nov 19 '05 #1
6 2706
Look at the System.Web.Mail namespace

it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp

basically create a new MailMessage, set all the properties (To, From,
Subject, Body) and use the Attachments.Add to point to the file to attach.

before doing a SmtpMail.Send though, you might need to do
SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"

I think by default it looks for an smtp server on the same machine as your
web site, which is probably what you want.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
I have a database application that is submitted to an Access database.
What
I want is when the form is submitted to automatically send an email to
multiple persons with the info from the form. This could be as an
attachement or plain text. I wouldn't care if it was like the mailto.
I'm
clueless on how to do this.
Any help would be greatly appreciated.

Nov 19 '05 #2
Thanks for your quick response karl.
Forgive me but I'm new to this stuff. I've looked at this before and didn't
really know how to implement this code. Is this from the CodeBehind or the
html
output?

"Karl Seguin" wrote:
Look at the System.Web.Mail namespace

it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp

basically create a new MailMessage, set all the properties (To, From,
Subject, Body) and use the Attachments.Add to point to the file to attach.

before doing a SmtpMail.Send though, you might need to do
SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"

I think by default it looks for an smtp server on the same machine as your
web site, which is probably what you want.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
I have a database application that is submitted to an Access database.
What
I want is when the form is submitted to automatically send an email to
multiple persons with the info from the form. This could be as an
attachement or plain text. I wouldn't care if it was like the mailto.
I'm
clueless on how to do this.
Any help would be greatly appreciated.


Nov 19 '05 #3
that sample is in the HTML view, but you can easily do this from the
codebehind in the button click event

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"havenoclue" wrote:
Thanks for your quick response karl.
Forgive me but I'm new to this stuff. I've looked at this before and didn't
really know how to implement this code. Is this from the CodeBehind or the
html
output?

"Karl Seguin" wrote:
Look at the System.Web.Mail namespace

it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp

basically create a new MailMessage, set all the properties (To, From,
Subject, Body) and use the Attachments.Add to point to the file to attach.

before doing a SmtpMail.Send though, you might need to do
SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"

I think by default it looks for an smtp server on the same machine as your
web site, which is probably what you want.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
I have a database application that is submitted to an Access database.
What
I want is when the form is submitted to automatically send an email to
multiple persons with the info from the form. This could be as an
attachement or plain text. I wouldn't care if it was like the mailto.
I'm
clueless on how to do this.
Any help would be greatly appreciated.


Nov 19 '05 #4
I tried the code behind and got
COMException (0x80040213): The transport failed to connect to the server

Dim email As New System.Web.Mail.MailMessage
email.To = " "
email.From = " "
email.Body = " "
email.Subject = " "
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send(email)

When I use my own server domain it gives me
550 5.7.1 Unable to relay for " "

"Curt_C [MVP]" wrote:

that sample is in the HTML view, but you can easily do this from the
codebehind in the button click event

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"havenoclue" wrote:
Thanks for your quick response karl.
Forgive me but I'm new to this stuff. I've looked at this before and didn't
really know how to implement this code. Is this from the CodeBehind or the
html
output?

"Karl Seguin" wrote:
Look at the System.Web.Mail namespace

it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp

basically create a new MailMessage, set all the properties (To, From,
Subject, Body) and use the Attachments.Add to point to the file to attach.

before doing a SmtpMail.Send though, you might need to do
SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"

I think by default it looks for an smtp server on the same machine as your
web site, which is probably what you want.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
>I have a database application that is submitted to an Access database.
>What
> I want is when the form is submitted to automatically send an email to
> multiple persons with the info from the form. This could be as an
> attachement or plain text. I wouldn't care if it was like the mailto.
> I'm
> clueless on how to do this.
> Any help would be greatly appreciated.

Nov 19 '05 #5
Where is your smtp serve rrunning?

As I said in my original post, you'll likely have to specify the address of
the SMTP server via SmtpMail.SmtpServer

IIS has an smtp server built-in, perhaps you need to start the service?
(simple mail transfer protocol I believe it's called), and point your
SmtpServer to 127.0.0.1 (local)

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:A5**********************************@microsof t.com...
I tried the code behind and got
COMException (0x80040213): The transport failed to connect to the server

Dim email As New System.Web.Mail.MailMessage
email.To = " "
email.From = " "
email.Body = " "
email.Subject = " "
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send(email)

When I use my own server domain it gives me
550 5.7.1 Unable to relay for " "

"Curt_C [MVP]" wrote:

that sample is in the HTML view, but you can easily do this from the
codebehind in the button click event

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"havenoclue" wrote:
> Thanks for your quick response karl.
> Forgive me but I'm new to this stuff. I've looked at this before and
> didn't
> really know how to implement this code. Is this from the CodeBehind or
> the
> html
> output?
>
> "Karl Seguin" wrote:
>
> > Look at the System.Web.Mail namespace
> >
> > it's pretty easy, check out:
> > http://www.aspheute.com/english/20000918.asp
> >
> > basically create a new MailMessage, set all the properties (To, From,
> > Subject, Body) and use the Attachments.Add to point to the file to
> > attach.
> >
> > before doing a SmtpMail.Send though, you might need to do
> > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
> >
> > I think by default it looks for an smtp server on the same machine as
> > your
> > web site, which is probably what you want.
> >
> > Karl
> >
> > --
> > MY ASP.Net tutorials
> > http://www.openmymind.net/
> > "havenoclue" <ha********@discussions.microsoft.com> wrote in message
> > news:69**********************************@microsof t.com...
> > >I have a database application that is submitted to an Access
> > >database.
> > >What
> > > I want is when the form is submitted to automatically send an email
> > > to
> > > multiple persons with the info from the form. This could be as an
> > > attachement or plain text. I wouldn't care if it was like the
> > > mailto.
> > > I'm
> > > clueless on how to do this.
> > > Any help would be greatly appreciated.
> >
> >
> >

Nov 19 '05 #6
Thanks Karl and Curt

I have it now. Just have more problems.

"Karl Seguin" wrote:
Where is your smtp serve rrunning?

As I said in my original post, you'll likely have to specify the address of
the SMTP server via SmtpMail.SmtpServer

IIS has an smtp server built-in, perhaps you need to start the service?
(simple mail transfer protocol I believe it's called), and point your
SmtpServer to 127.0.0.1 (local)

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"havenoclue" <ha********@discussions.microsoft.com> wrote in message
news:A5**********************************@microsof t.com...
I tried the code behind and got
COMException (0x80040213): The transport failed to connect to the server

Dim email As New System.Web.Mail.MailMessage
email.To = " "
email.From = " "
email.Body = " "
email.Subject = " "
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send(email)

When I use my own server domain it gives me
550 5.7.1 Unable to relay for " "

"Curt_C [MVP]" wrote:

that sample is in the HTML view, but you can easily do this from the
codebehind in the button click event

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"havenoclue" wrote:

> Thanks for your quick response karl.
> Forgive me but I'm new to this stuff. I've looked at this before and
> didn't
> really know how to implement this code. Is this from the CodeBehind or
> the
> html
> output?
>
> "Karl Seguin" wrote:
>
> > Look at the System.Web.Mail namespace
> >
> > it's pretty easy, check out:
> > http://www.aspheute.com/english/20000918.asp
> >
> > basically create a new MailMessage, set all the properties (To, From,
> > Subject, Body) and use the Attachments.Add to point to the file to
> > attach.
> >
> > before doing a SmtpMail.Send though, you might need to do
> > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
> >
> > I think by default it looks for an smtp server on the same machine as
> > your
> > web site, which is probably what you want.
> >
> > Karl
> >
> > --
> > MY ASP.Net tutorials
> > http://www.openmymind.net/
> > "havenoclue" <ha********@discussions.microsoft.com> wrote in message
> > news:69**********************************@microsof t.com...
> > >I have a database application that is submitted to an Access
> > >database.
> > >What
> > > I want is when the form is submitted to automatically send an email
> > > to
> > > multiple persons with the info from the form. This could be as an
> > > attachement or plain text. I wouldn't care if it was like the
> > > mailto.
> > > I'm
> > > clueless on how to do this.
> > > Any help would be greatly appreciated.
> >
> >
> >


Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by dcass | last post: by
1 post views Thread by dmiller23462 | last post: by
1 post views Thread by Piotr Kurpiel | last post: by
1 post views Thread by raqfg | last post: by
7 posts views Thread by James Thomas | last post: by
1 post views Thread by grpmangr | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.