Asp.net 2.0 Mail
-
i Have given image tag inside td in Body but not displaying message. but if i tried for inline attachment with System.Net.Mail.LinkedResource then getting as image embed but while embeding like this mails are getting late to send follow is the code part i am using
Body = "
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
-
i Have given image tag inside td in Body but not displaying message. but if i tried for inline attachment with System.Net.Mail.LinkedResource then getting as image embed but while embeding like this mails are getting late to send follow is the code part i am using
Body = "
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
I can only see fractions of your code. Use the "Ignore HTML" option when you are posting markup code.
sathimailin1 wrote:
i Have given image tag inside td in Body but not displaying message.
Is it the mail message that is not displayed, or the contents of the message that is not displayed? Where is it not displayed?
sathimailin1 wrote:
while embeding like this mails are getting late to send
How are you embedding the image? What do you mean by "late to send"?
Despite everything, the person most likely to be fooling you next is yourself.
-
I can only see fractions of your code. Use the "Ignore HTML" option when you are posting markup code.
sathimailin1 wrote:
i Have given image tag inside td in Body but not displaying message.
Is it the mail message that is not displayed, or the contents of the message that is not displayed? Where is it not displayed?
sathimailin1 wrote:
while embeding like this mails are getting late to send
How are you embedding the image? What do you mean by "late to send"?
Despite everything, the person most likely to be fooling you next is yourself.
string Body; AlternateView htmlIV;
SqlConnection _oSqlconn;
SqlCommand _oSqlCmd;
SqlDataAdapter _oAdapt = new SqlDataAdapter();
DataTable DT;
DT = new DataTable();
string Sqlstr;\_oSqlconn = new SqlConnection(ConfigurationManager.AppSettings\["Test"\]); \_oSqlconn.Open(); Sqlstr = "select cEmail\_id1 from Master\_Contacts"; \_oSqlCmd = new SqlCommand(Sqlstr, \_oSqlconn); \_oSqlCmd.CommandType = CommandType.Text; \_oAdapt.SelectCommand = \_oSqlCmd; \_oAdapt.Fill(DT); \_oSqlconn.Close(); Body = ""; Body += ""; Body += ""; Body += "
";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
htmlIV = System.Net.Mail.AlternateView.CreateAlternateViewFromString(Body, null, "text/html"); System.Net.Mail.LinkedResource imagelink = new System.Net.Mail.LinkedResource(Server.MapPath(".") + "\\\\images\\\\S.jpg", "image/jpeg"); imagelink.ContentId = "imageId"; imagelink.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; htmlIV.LinkedResources.Add(imagelink); System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage("xyc2@yahoo.com", Convert.ToString(DT.Rows\[i\]\["cEmail\_id1"\]), ConfigurationManager.AppSettings\["Subj"\], Body); mail.AlternateViews.Add(htmlIV); System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential(ConfigurationManager.AppSettings\["MailID"\], ConfigurationManager.AppSettings\["Pass"\]); System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 25); mailClient.EnableSsl = true; mailClient.UseDefaultCredentials = false; mailClient.Credentials = mailAuthentication; mailClient.Send(mail);
Above is the way i used to send a mail with embed image and this becomes slow to send mail i.e to send 5 mails for example it takes 3 minutes. II i tried to write an image inside td of Body message src=mypath instead of src='cid:imageId' but result is i am getting
-
i Have given image tag inside td in Body but not displaying message. but if i tried for inline attachment with System.Net.Mail.LinkedResource then getting as image embed but while embeding like this mails are getting late to send follow is the code part i am using
Body = "
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
Body += "";
specify full path of your image like http://yoursite.com/images/S.JPG....
-
specify full path of your image like http://yoursite.com/images/S.JPG....
-
Hi Thanks image got displayed when i give path as you mentioned but in gmail when opening mail gmail is showing diplay images below i dont want to get message rather it should display image when user open a mail, can u tell me why i am getting error