how to send emails via aspx

  • Thread starter Thread starter farhan wajahat
  • Start date Start date
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
 
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
===========
 
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?
 
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
 
Post your complete code
( without your smtp server name )
and I'll check it out locally.



Juan T. Llibre
ASP.NET MVP
===========
 
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
 
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/)
 
Back
Top