New Message on dotNET User Group Hyd

Sending Mail to diffrent servers

Reply
  Reply to Sender   Recommend Message 4 in Discussion
From: vamsum_kris

Hi rajesh!
As soon i got ur mail i started working asap.
Plz try the following:
 
In your web application project goto:
Project->Add Reference
In the add reference dialog box select System.web.dll
click select and ok to close the dialog
 
now use the namespace System.web.Mail
imports System.Web.Mail
 
now write the code as following:
 
Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
Message.To = "[EMAIL PROTECTED]"
Message.From = "<To be configured>"      'SEE NOTES BELOW
Message.Subject = "Sub"
Message.Body = "Hi to myself!"
SmtpMail.SmtpServer = "<To be configured>" 'SEE NOTES BELOW
SmtpMail.Send(Message)
-----------------------------------------------------
Now Goto Control Panel and select Administrative Tools-> Internet Information Services
Now expand the Web Sites Node and right click on the Default Website (or the website u r hosting) and Rightclick and select All Tasks->Configure Server Extensions.
Now click on Next and ull see a dialog box Titled Mail Server.
NOW COPY THE TEXT IN THE TEXTBOX THAT SAYS "Who should appear as author of the mail that this web server sends. This should be the text in the Message.From property.
NOW COPY THE TEXT IN THE TEXTBOX THAT SAYS "The smtp mail server should this web server use to send messages." This should be the text in the SmtpMail.SmtpServer property
If this method fails then put the SmtpMail.SmtpServer property to empty string that would cause the server to use the default mail server. Even if this fails then i guess we have a problem in here!
First make sure ur mail server is configured by the System administrator. If ur Server Extensions configuration shows empty strings in the server textbox then it is not configured properly.Plz configure it before u try this out!
If all this fails i can give u samples to send mail using outlook express objects but remember I NEVER KNOW OF ANY WEB APPLICATION USE THIS METHOD TO SEND MAIL USING OUTLOOK OBJECTS its probably not at all recommended!

 
i hope this helps u
 
-Vamshi Krishna
([EMAIL PROTECTED])

View other groups in this category.

Click Here
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to