Click here to Skip to main content
15,896,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to send a mail from my ASP.net page to mailserver.

see my code
-----------
dim Mailss as object = Server.CreateObject("jmail.SMTPMail")
Mailss .ServerAddress = "servername"
      Mailss .sender = String.IsNullOrEmpty(PLEmail)
      Mailss .AddRecipient("ram@example.com")



but,jmail is not working..

How to do that...?
Posted
Updated 18-Jul-11 1:14am
v2

This is not the way you do it .Net. Have a look at this one:

Sending an Email in C# with or without attachments: generic routine.

It's in c# though, but should not be difficult to convert.
 
Share this answer
 
Comments
gani7787 18-Jul-11 7:48am    
Hi,
I have used below code. but, it says error.

Error : mailmessage not defined.

see code.
----------
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress("me@mycompany.com")
mail.To.Add("you@yourcompany.com")

'set the content
mail.Subject = "This is an email"
mail.Body = "this is a sample body"

'send the message
Dim smtp As New SmtpClient("127.0.0.1")
smtp.Send(mail)
Hope this[^] might help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900