Click here to Skip to main content
14,269,494 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello to all i am making an web application.. i have an image,and some text on the page..

i want to send that image and text through mail..i have coded like this..

protected void LinkButton1_Click(object sender, EventArgs e)
      //Session["name"] = lblname.Text;
      //Session["rate"] = lblrate.Text;
      //Session["img"] = lblimg.Text;
      Response.Redirect("email.aspx?val=" + Server.UrlEncode(lblname.Text) + "val1=" + Server.UrlEncode(lblrate.Text) + "val2=" + Server.UrlEncode(lblimg.Text));


now on the next page--

public partial class email : System.Web.UI.Page
    string val;
    protected void Page_Load(object sender, EventArgs e)
     if(Request.QueryString["val"]!=null  || Request.QueryString["val1"]!=null || Request.QueryString["val1"]!=null)

       val = Request.QueryString["val"].ToString() + Request.QueryString["val"].ToString() + Request.QueryString["val"].ToString();
        //val1= Request.QueryString["val1"].ToString();
        //val2 = Request.QueryString["val2"].ToString();

    protected void btnsend_Click(object sender, EventArgs e)
      MailMessage msg = new MailMessage();
      msg.IsBodyHtml = true;
      msg.Subject = txtsub.Text;
      msg.Body = txtmsg.Text + val;
      msg.From = new MailAddress(txtfrom.Text);

      SmtpClient smtp = new SmtpClient();
      smtp.Host = "";
      smtp.Credentials = new System.Net.NetworkCredential("removed", "remove");
      smtp.EnableSsl = Convert.ToBoolean(true);

the mail is sending but in the mail there is coming like

subject hi
Images from this sender are always displayed. Don't display from now on.

hide details 12:34 PM (2 minutes ago)


Email id and password removed.
Updated 25-Jun-10 21:38pm
PSK_ 26-Jun-10 3:36am
Please use pre tags for your code blocks.
PSK_ 26-Jun-10 3:39am
Don't mention your original email id and password. You have provided your valid gmail id and password

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Images from this sender are always displayed. Don't display from now on.

Display images below - Always display images from

this is normal! for me, all received messages in Gmail, I get this message.

try another smtp server for comparing them.

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100