471,317 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Email Form in ASP.NET

hiya,

i would like to make a contact form in my website. i've looked all over the
web for instructions but none of them work.

in case you dont know what i mean, i want a form with fields like name,
email address and comment and i want the submitted values to be sent to my
email address.

thanks in advance. by the way, is there a 'chat group' like this for asp.net?
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
Feb 15 '06 #1
4 1204
Dan
There is a mail object in asp.net which does exactly that, create an
instance of it and look at its methods, really easy to use. Amazed you
couldnt find tutorials for it on the net?

And yes there is, microsoft.public.dotnet.framework.aspnet .

--
Dan
"Helter Skelter" <He***********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
hiya,

i would like to make a contact form in my website. i've looked all over
the
web for instructions but none of them work.

in case you dont know what i mean, i want a form with fields like name,
email address and comment and i want the submitted values to be sent to my
email address.

thanks in advance. by the way, is there a 'chat group' like this for
asp.net?
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!

Feb 15 '06 #2
hi,

sorry, im no the best csharpist. what sort of object? ive only got
maildefinition, maildefinitionconverter, maileventargs and mailevent handler
in the intellisense in a script block
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
"Dan" wrote:
There is a mail object in asp.net which does exactly that, create an
instance of it and look at its methods, really easy to use. Amazed you
couldnt find tutorials for it on the net?

And yes there is, microsoft.public.dotnet.framework.aspnet .

--
Dan
"Helter Skelter" <He***********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
hiya,

i would like to make a contact form in my website. i've looked all over
the
web for instructions but none of them work.

in case you dont know what i mean, i want a form with fields like name,
email address and comment and i want the submitted values to be sent to my
email address.

thanks in advance. by the way, is there a 'chat group' like this for
asp.net?
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!


Feb 15 '06 #3
i've looked all over
the
web for instructions but none of them work.
you obviously haven't spent time researching the issue. Maybe you should
spend some time looking at the .net mail object on the web.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"Helter Skelter" <He***********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
hi,

sorry, im no the best csharpist. what sort of object? ive only got
maildefinition, maildefinitionconverter, maileventargs and mailevent handler in the intellisense in a script block
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
"Dan" wrote:
There is a mail object in asp.net which does exactly that, create an
instance of it and look at its methods, really easy to use. Amazed you
couldnt find tutorials for it on the net?

And yes there is, microsoft.public.dotnet.framework.aspnet .

--
Dan
"Helter Skelter" <He***********@discussions.microsoft.com> wrote in message news:2F**********************************@microsof t.com...
hiya,

i would like to make a contact form in my website. i've looked all

over the
web for instructions but none of them work.

in case you dont know what i mean, i want a form with fields like name, email address and comment and i want the submitted values to be sent to my email address.

thanks in advance. by the way, is there a 'chat group' like this for
asp.net?
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!


Feb 15 '06 #4
Spoon-feeding:

//lib
using System.Web.Mail;

// snippet
SmtpMail.SmtpServer = "smtp.server.of.choice";
MailMessage objEmail = new MailMessage();
objEmail.To = recipientEmailAddress;
objEmail.From = senderEmailAddress;

try
{
// intelli-sense on objEmail for fun and profit
objEmail.Subject = subjectLine;
objEmail.Body = emailBody;
objEmail.BodyFormat = MailFormat.Html;
if (!(alAttachmentList == null)) // assuming ArrayList
{
foreach (MailAttachment ma in alAttachmentList)
{
objEmail.Attachments.Add(ma);
}
}
SmtpMail.Send(objEmail);
}
catch {}
Feb 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by bojanraic | last post: by
88 posts views Thread by Mike | last post: by
4 posts views Thread by Ken D. | last post: by
26 posts views Thread by libsfan01 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.