sending email

J

Jim in Arizona

I've made an application that is a computer problems (tickets) system. The
employee goes to a web page and posts the comptuer problem they're having.
Then, the IS staff goes to another webpage (both pages aspx of couse) which
shows the posts by the employees. From there, we assign the problems
(tickets) to each other, set priorities and add notes as neccessary.

What I want to do is, when an employee posts a new problem, have an email
sent out to our email address so we know when a new problem has been posted.
I thought about doing it with SQLMail but i've had all kinds of problems
making that work and I've given up on it. There's a bit more to learn with
that since I've never created any kind of trigger or strored procedure
before.

We have a win2000 AD setup and use exchange2000 as our email server. I was
thinking of some kind of code that will execute when they click the button
that does the DB insert statement. I absolutely hope that, if anyone does
have an example, that it is in VB. :)

Also, since exchange authentication is done via AD, how would I go about
setting up something like that on the server(s) side? Since anonymous access
is turned off on my IIS 5.0 server, how would this work, or would that even
matter?

TIA!
Jim
 
S

S. Justin Gengo

Jim,

Typically you shouldn't need to authenticate to your exchange server before
sending an email. But that would all depend on how your network is set up.

Try this code and see if it works. You'll get a permissions error if you
need to authenticate...

Dim Message As New System.Web.Mail.MailMessage

Message.BodyFormat = Mai.MailFormat.Text '---Can also be set to HTML

Message.To = "[your email address to send to]"

Message.From = "[your from email address here]"

Message.Subject = "Help Desk Alert!"

Message.Body = "Main message"

Dim Mail As System.Web.Mail.SmtpMail

Mail.SmtpServer = "localhost" '---If your web server is set up to send email
via your exchange server (a common setup) specifying local host will work.
Otherwise try naming your exchange server here.

Mail.Send(Message)


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
J

Jim in Arizona

S. Justin Gengo said:
Jim,

Typically you shouldn't need to authenticate to your exchange server
before sending an email. But that would all depend on how your network is
set up.

Try this code and see if it works. You'll get a permissions error if you
need to authenticate...

Dim Message As New System.Web.Mail.MailMessage

Message.BodyFormat = Mai.MailFormat.Text '---Can also be set to HTML

Message.To = "[your email address to send to]"

Message.From = "[your from email address here]"

Message.Subject = "Help Desk Alert!"

Message.Body = "Main message"

Dim Mail As System.Web.Mail.SmtpMail

Mail.SmtpServer = "localhost" '---If your web server is set up to send
email via your exchange server (a common setup) specifying local host will
work. Otherwise try naming your exchange server here.

Mail.Send(Message)


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer


I forgot to mention that I'm using the .NET Framework 2.0 Beta 2. When I try
to use the System.Web.Mail class, Visual Studio tells me that the class is
deprecated and is very tempormental about it. It lets me use it anyway until
I get down to the Mail.SMTPServer = "host" part, in which case it doesn't
even show an option for SMTPserver and then other things start to change and
get underlined in blue. It's a bit frustrating.

The new class it tells me to use is System.Net.Mail, which I tried but the
properties and methods aren't completey the same and the ones that are, such
as the To and From, are read only and I can't set them for some reason. I
was able to do Message.To.Add([email protected]) but when I tried
Message.From, there was no Add method and if I just tried Message.From =
(e-mail address removed), it wouldn't work or Message.From([email protected]),
same thing. Errors.

I'm going to have to find a 2.0 equivelant for this. :(

Thanks for your help though. It pointed me in a direction I need to be
looking at.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top