Email Form in ASP.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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 .
 
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!
 
i've looked all over
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
 
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 {}
 
Back
Top