none
How to send an email..? RRS feed

Answers

  • asdasdsa asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a dasdsad a
    • Marked as answer by SRKR Friday, August 27, 2010 5:40 PM
    Friday, August 27, 2010 5:39 PM

All replies

  • asdasdsa asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a asdasdsa dasdsad a dasdsad a
    • Marked as answer by SRKR Friday, August 27, 2010 5:40 PM
    Friday, August 27, 2010 5:39 PM
  • Yep and then you press send ;-)

    Maurice

    Friday, August 27, 2010 9:42 PM
  •    public void sendMail()
            {

                    string mailTemplateFile = "";
                    string strEmailId = "";           
                    MailMessage mMailMessage = new MailMessage();

                    if (strEmailId.Trim() != string.Empty && strEmailId != string.Empty)
                    {
                        mMailMessage.From = new MailAddress(strEmailId);          
                        mMailMessage.To.Add(new MailAddress(strEmailId));
                        mMailMessage.Subject = "From:me.com: ";
                        mMailMessage.Body = BuildMailBody("<Should be in HTML>");
                        mMailMessage.IsBodyHtml = true;
                        mMailMessage.Priority = MailPriority.Normal;
                        SmtpClient mSmtpClient = new SmtpClient(ConfigurationManager.AppSettings["MailExchangeServerName"].ToString());
                        mSmtpClient.Send(mMailMessage);
                    }

                }
             
            }

    Sunday, August 29, 2010 5:56 PM
  • Hi,

    I will define some easy steps to email, the options to compose a new email can be different 'depends on softwares, however the basic rules & steps are same.

    Here I will follow with MS Outlook 2007.

    Step1 : Click on "New", by doing this you will get a blank email message to compose.

    Step2 : Then you need give a "Subject" to email message. Which should be very specific to the message and not exeeded to 15-20 words.

    Step3 : Then in body field first you need to write the attendent name with proper "Salutation" & greeting.

    Step4 : After greetings, you need to type message with proper delivery, simple language(avoid Jagrans), use correct puncuations. It will be good impresstion to use small sentences of not more than 30-35 words. Where you can use table or bullets & numbering please do use. Message should be clear & concise.

    Step5 : After copeletion of massage, put some closer based on situation like "looking forward for you revert" or "thank you" etc.

    Step6 : Put your "Signatures" in the end of the email with "Regards". Signatures must have you Full Name, Designation(if official email), Full Address with zipcode & contact number with mobile & fax(if you like).

    Step7 : Do proof reading of your entire massage, atleast twice.

    Step8 : If now you think massage has been properly drafted, put the recipients in To & CC filed appropriatly.

    Step9 : Then click send to send EMail message.

    For more assistance on Email message Adequates, please feel free to write me on sachingoels@gmail.com, I will feel happy to assist you.

    Regards

    Sachin Goel

    • Proposed as answer by GrumpyBum Monday, August 30, 2010 11:16 AM
    Monday, August 30, 2010 10:41 AM
  • Thank you!
    Monday, August 30, 2010 4:40 PM
  • How to show a javascript popup calender at non-locatable place...??
    Monday, August 30, 2010 4:41 PM
  • Follow as below u will get it...

     

     

    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Net.Mail;
    using System.Collections;
    using System.Collections.Generic;
    using System.Text;
    using System.IO;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string strMail = string.Empty;
            string strSubject = string.Empty;
            string strTemplateHTMLFileName = string.Empty;
            MailMessage objMailEntireMessage = new MailMessage();

            string strCutomerStoreNzme1 = "MORE";
            string strCutomerStoreNzme2 = "HYPER";
            string strCutomerStoreNzme3 = "REEP";

            StringBuilder sbStoreNames = new StringBuilder();
            sbStoreNames.Append(strCutomerStoreNzme1);
            sbStoreNames.Append("<br />");
            sbStoreNames.Append(strCutomerStoreNzme2);
            sbStoreNames.Append("<br />");
            sbStoreNames.Append(strCutomerStoreNzme3);
            sbStoreNames.Append("<br />");


            string strAllStores = sbStoreNames.ToString();
            string strMainCustomerName = "CREEMAN";

            string strCustomerStores = strMainCustomerName + "," + strAllStores;

            string[] arrCustomerStoreNames = strCustomerStores.Split(',');

            //Required to have

            Hashtable hstCustStores = new Hashtable();
            hstCustStores.Add("[strStoresHead]", arrCustomerStoreNames[0]);
            hstCustStores.Add("[strCustomerStoreNames]", arrCustomerStoreNames[1]);

            strSubject = "Customer Store Names";
            strTemplateHTMLFileName = ConfigurationManager.AppSettings["MailFormatPath"].ToString();
            objMailEntireMessage.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"].ToString());
            objMailEntireMessage.To.Add(new MailAddress(ConfigurationManager.AppSettings["ToAddress"].ToString()));

            // Constructing the mail body from the template file

            if (File.Exists(strTemplateHTMLFileName))
            {
                StreamReader objStreamReader = File.OpenText(strTemplateHTMLFileName);
                strMail = objStreamReader.ReadToEnd();
                foreach (DictionaryEntry DEentry in hstCustStores)
                {
                    strMail = strMail.Replace(DEentry.Key.ToString(), DEentry.Value.ToString());
                }
                objStreamReader.Close();
            }
            else
            {
                throw new Exception("Access to the file is denied");
            }

            objMailEntireMessage.Subject = strSubject;
            objMailEntireMessage.IsBodyHtml = true;
            objMailEntireMessage.Priority = MailPriority.Normal;
            objMailEntireMessage.Body = strMail;
            try
            {
                SmtpClient objSmtpClient = new SmtpClient(ConfigurationManager.AppSettings["SmtpClient"].ToString());
                objSmtpClient.Send(objMailEntireMessage);
            }
            catch (SmtpFailedRecipientsException e3)
            {
                throw e3;
            }
            catch (SmtpException e1)
            {
                throw e1;
            }



        }
    }

    Wednesday, September 1, 2010 5:48 PM
  • for reference for the above

     

    <add key="MailFormatPath" value="D:\MyTemplates\MailToStores.htm"/>
            <add key="FromAddress" value="abc@rcan.com"/>
            <add key="ToAddress" value="sam@reep.com"/>
            <add key="SmtpClient" value="PTRN100XXXXX"/>

     

    <html>

    <head>
    </head>

    <body>
    <p>

    Dear [strStoresHead],

    Please find the Customer Store Names.
    [strCustomerStoreNames]


    Regards,
    Stores System.
    Please do not reply

    </body>
    </html>

    Wednesday, September 1, 2010 5:51 PM
  • Can any on eplease help me in Page Methods with example..

     

    Thanks in advance...

    Wednesday, September 1, 2010 5:59 PM
  • Please follow as below...

     

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>

        <script language="javascript" type="text/javascript">
        function f()
        {
        alert("Hi");
        }
       
        </script>

    </head>
    <body>

        <script type="text/javascript" language="javascript" src="script.js">  </script>

        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <div>
            <asp:Label ID="lblCustId1" runat="server" Text="Customer ID 1"></asp:Label>
            <asp:TextBox ID="txtId1" runat="server"></asp:TextBox><br />
            <asp:TextBox ID="txtContact1" runat="server" BorderColor="Transparent" BorderStyle="None"
                ReadOnly="True"></asp:TextBox><br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server" BorderColor="Transparent" BorderStyle="None"
                ReadOnly="True"></asp:TextBox>
            <%-- <asp:Label ID="lblCustId2" runat="server" Text="Customer ID 2"></asp:Label>
            &nbsp;
            <asp:TextBox ID="txtId2" runat="server"></asp:TextBox><br />
            <asp:TextBox ID="txtContact2" runat="server" BorderColor="Transparent" BorderStyle="None"
                ReadOnly="True"></asp:TextBox>&nbsp;<br />--%>
        </div>
        </form>
    </body>
    </html>

     

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtId1.Attributes.Add("onblur", "javascript:CallMe('" + txtId1.ClientID + "', '" + txtContact1.ClientID + "','" + TextBox1.ClientID + "')");
               // txtId2.Attributes.Add("onblur", "javascript:CallMe('" + txtId2.ClientID + "', '" + txtContact2.ClientID + "')");
            }

        }
        [System.Web.Services.WebMethod]
        public static string GetContactName(string custid)
        {
            return "Hi I am " + custid;
        }

        [System.Web.Services.WebMethod]
        public static string GetContactName2(string custid)
        {
            return "yes True " + custid;
        }

     

    below is in a script.js file

     

    function CallMe(src,dest,dest2)
     {   
         var ctrl = document.getElementById(src);
         // call server side method
         PageMethods.GetContactName(ctrl.value, CallSuccess, CallFailed, dest);
        
         PageMethods.GetContactName2(ctrl.value, CallSuccess2, CallFailed, dest2);
     }
     
     // set the destination textbox value with the ContactName
     function CallSuccess(res, destCtrl)
     {   
         var dest = document.getElementById(destCtrl);
         dest.value = res;
        
     }
     
     function CallSuccess2(res, destCtrl)
     {   
         var dest = document.getElementById(destCtrl);
         dest.value = res;
        
     }
     
     // alert message on some failure
     function CallFailed(res, destCtrl)
     {
         alert(res.get_message());
     }

    Wednesday, September 1, 2010 6:02 PM
  • Hi SRKR,

    As you might have noticed by now this forum has it's focus on training and certification. I think you might have more success posting you question in one of the following forums: http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio

    There you'll get the response you are hoping for although Mohan has been very helpful so far.

    So pls try to keep the postings in the appropriate forum.

    Maurice

    Wednesday, September 1, 2010 7:30 PM