how to send emails via aspx

F

farhan wajahat

i have made a command button and on the click event of
the button following code is mentioned:

im mailnew As New MailMessage()
mailnew.From = "(e-mail address removed)"
mailnew.To = "(e-mail address removed)"
mailnew.Cc = "(e-mail address removed)"
mailNew.Subject = "New Record Entered
Successfully"
mailNew.Body = "Data successfully entered by user
farhan.w"
SmtpMail.Send(mailNew)

now when i click the command button nothing happens,
neither i rcv any emails. We are using exchange server
and proper rights are being assigned to the user sending
this email "financialadjustments" is the user authorized
please help
 
J

Juan T. Llibre

You're not specifying an smtp server.

If you don't do that, the default smtpserver is localhost.

When I use "localhost" for an smtp server, mail is never sent.

When I specify an smtp server by name, mail gets sent.

Are you using your own smtp server ?

Or are you specifying an smtp server to which
you have a right to access, or a smart host ?

The format to specify your smtp server is :

SmtpMail.SmtpServer = "mail.whatever.com"
( any valid mail server name )




Juan T. Llibre
ASP.NET MVP
===========
 
F

farhan wajahat

i am specifying the mail server now in the same code as
per mentioned but i am still unable to send any mail.
What could be the issue?
 
G

Guest

yes i have smtp server to which i have rights to access
what to do now? i am specifying the server name i.e
xyz.abc.net but the mail is not sent
 
J

Juan T. Llibre

Post your complete code
( without your smtp server name )
and I'll check it out locally.



Juan T. Llibre
ASP.NET MVP
===========
 
J

Jim Lawton

i have made a command button and on the click event of
the button following code is mentioned:

im mailnew As New MailMessage()
mailnew.From = "(e-mail address removed)"
mailnew.To = "(e-mail address removed)"
mailnew.Cc = "(e-mail address removed)"
mailNew.Subject = "New Record Entered
Successfully"
mailNew.Body = "Data successfully entered by user
farhan.w"
SmtpMail.Send(mailNew)

now when i click the command button nothing happens,
neither i rcv any emails. We are using exchange server
and proper rights are being assigned to the user sending
this email "financialadjustments" is the user authorized
please help

First question is, is the mail appearing in your SMTP queue?

Jim
 
G

Guest

i have made a command button and on the click event of
the button following code is mentioned:

im mailnew As New MailMessage()
mailnew.From = "(e-mail address removed)"
mailnew.To = "(e-mail address removed)"
mailnew.Cc = "(e-mail address removed)"
mailNew.Subject = "New Record Entered
Successfully"
mailNew.Body = "Data successfully entered by user
farhan.w"
SmtpMail.Send(mailNew)

now when i click the command button nothing happens,
neither i rcv any emails. We are using exchange server
and proper rights are being assigned to the user sending
this email "financialadjustments" is the user authorized
please hel

User submitted from AEWNET (http://www.aewnet.com/)
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top