Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. I want to create option like print and mail to friend in my site same as codeproject

I want to create option like print and mail to friend in my site same as codeproject

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cooolguymca
    wrote on last edited by
    #1

    can any body help me in this regard. How can i put these facility like codeproject did. Print and mail to friend options

    Umesh

    N L 2 Replies Last reply
    0
    • C cooolguymca

      can any body help me in this regard. How can i put these facility like codeproject did. Print and mail to friend options

      Umesh

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      cooolguymca wrote:

      Print

      Done by JS. window.print() should do. BTW, you can view the source of code project page and see how they implemented it.

      cooolguymca wrote:

      mail to friend

      Read about System.Net.MailMessage and System.Net.SmtpClient classes.

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • C cooolguymca

        can any body help me in this regard. How can i put these facility like codeproject did. Print and mail to friend options

        Umesh

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        For sending mail use code

        using System;
        using System.Data;
        using System.Configuration;
        using System.Web;
        using System.Web.Security;
        using System.Web.UI;
        using System.Web.UI.WebControls;
        using System.Web.UI.WebControls.WebParts;
        using System.Web.UI.HtmlControls;
        using System.Net.Mail;

        public class clsSendMail
        {
        private String SMTPServer = string.Empty;
        public clsSendMail()
        {
        SMTPServer = "localhost";
        }

        public String getSMTPServerName()
        {
            return SMTPServer;
        }
        
        public bool SendMail(String strToUser, String strFromUser, String strSubject, String strMessage)
        {
            bool blnResult = true;
            MailMessage myMail = new MailMessage();
            SmtpClient objSMTP = new SmtpClient(SMTPServer);
        
            myMail.To.Add(strToUser);
            myMail.From = new MailAddress(strFromUser);
            myMail.Subject = strSubject;
            myMail.Body = strMessage;
            myMail.IsBodyHtml = true;
        
            try
            {
                //obClient.Send(myMail);
                objSMTP.Send(myMail);
                blnResult = true;
            }
            catch
            {
                blnResult = false;
            }
        
            return blnResult;
        }
        

        }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups