How to send mail to inform user of login name and password.

asp.net Mauritius
  • 14 years ago

    Hi Friends,

    I would like to know how to automate the system to send mail to each user after sign up on a website. As this is usually an automated system and the user just receive an email from the server to inform him that his request has been accepted and his user name is:....... & password is:........ Please help if you can provide me with the code in asp.net (VB language).

    thanks.

  • 14 years ago

           public  void AutoSendEmail_Action ()

    {
       
       // use a post for email formatting
       Post post = new Post();
       post.Subject = subject.Text;
       post.Body = message.Text;
       post.PostType = FreeTextBoxControls.FreeTextBox.IsRichCapable(Context) ? PostType.HTML : PostType.BBCode;
       post.FormattedBody = Transforms.FormatPost(message.Text, post.PostType);   
       post.PostDate = DateTime.Now;
       post.User = Users.GetUser();
       post.Username = Users.GetUser().Username;









       User toUser = Users.GetUser( forumContext.UserID, true );

       if( toUser != null )
        Emails.UserToUser(forumContext.User, toUser, post);

       throw new ForumException(ForumExceptionType.EmailSentToUser);
            }

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The generation of random numbers is too important to be left to chance.” - Robert R. Coveyou