Click here to Skip to main content
15,899,754 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionplacing my application on the internet [modified] Pin
harcaype19-Nov-08 1:01
harcaype19-Nov-08 1:01 
AnswerRe: placing my application on the internet Pin
ToddHileHoffer19-Nov-08 2:15
ToddHileHoffer19-Nov-08 2:15 
GeneralRe: placing my application on the internet Pin
harcaype19-Nov-08 5:46
harcaype19-Nov-08 5:46 
Questiondisplaying image in datalist.? Pin
Mir_As18-Nov-08 23:48
Mir_As18-Nov-08 23:48 
AnswerRe: displaying image in datalist.? Pin
Nishant Singh21-Nov-08 2:32
Nishant Singh21-Nov-08 2:32 
QuestionAsp.net 2.0 Mail Pin
Satish_S18-Nov-08 23:44
Satish_S18-Nov-08 23:44 
AnswerRe: Asp.net 2.0 Mail Pin
Guffa18-Nov-08 23:55
Guffa18-Nov-08 23:55 
GeneralRe: Asp.net 2.0 Mail Pin
Satish_S19-Nov-08 0:11
Satish_S19-Nov-08 0:11 
<pre>


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 = "<table cellpadding='0' cellspacing='0' bgcolor='#c1c1c1' align='center' width='100%' border='0'>";
Body += "<td align='center'>";
Body += "<table cellpadding='0' cellspacing='0' align='center' width='600' height='703' border='0'>";
Body += "<tr>";
Body += "<td align='center'><img alt='' hspace=0 src='cid:imageId' align=middle border=0 ></td>";
Body += "</tr>";
Body += "</table>";
Body += "</td>";
Body += "</tr>";
Body += "</table>";

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);

</pre>


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 mails deliverd but if i open a mail then mail not displayed any images
AnswerRe: Asp.net 2.0 Mail Pin
knbinoj5819-Nov-08 0:13
knbinoj5819-Nov-08 0:13 
GeneralRe: Asp.net 2.0 Mail Pin
Satish_S19-Nov-08 0:28
Satish_S19-Nov-08 0:28 
GeneralRe: Asp.net 2.0 Mail Pin
knbinoj5819-Nov-08 1:13
knbinoj5819-Nov-08 1:13 
GeneralRe: Asp.net 2.0 Mail Pin
Satish_S19-Nov-08 1:52
Satish_S19-Nov-08 1:52 
QuestionHow to use jquery to notify ASP an event has happened Pin
Ponzano Paolo18-Nov-08 23:07
Ponzano Paolo18-Nov-08 23:07 
QuestionWhat will be the mime type of an ASPX file so that the IIS will know it is an web form and execute ? Pin
Nadia Monalisa18-Nov-08 21:06
Nadia Monalisa18-Nov-08 21:06 
AnswerRe: What will be the mime type of an ASPX file so that the IIS will know it is an web form and execute ? Pin
Guffa18-Nov-08 23:49
Guffa18-Nov-08 23:49 
GeneralRe: What will be the mime type of an ASPX file so that the IIS will know it is an web form and execute ? Pin
Nadia Monalisa19-Nov-08 10:39
Nadia Monalisa19-Nov-08 10:39 
QuestionSet Treeview to Retain it's State when a node is selected Pin
Vijay Mesa18-Nov-08 20:47
Vijay Mesa18-Nov-08 20:47 
QuestionHow to get the return value of Javascript Confirmation MessageBox in ASP.Net? Pin
codddy18-Nov-08 20:29
codddy18-Nov-08 20:29 
AnswerRe: How to get the return value of Javascript Confirmation MessageBox in ASP.Net? Pin
smarttom9918-Nov-08 20:54
smarttom9918-Nov-08 20:54 
GeneralRe: How to get the return value of Javascript Confirmation MessageBox in ASP.Net? Pin
codddy18-Nov-08 20:59
codddy18-Nov-08 20:59 
GeneralRe: How to get the return value of Javascript Confirmation MessageBox in ASP.Net? Pin
smarttom9918-Nov-08 21:03
smarttom9918-Nov-08 21:03 
QuestionAjax in Asp.net Pin
Rajesh Kumar Chekuri18-Nov-08 20:17
Rajesh Kumar Chekuri18-Nov-08 20:17 
AnswerRe: Ajax in Asp.net Pin
Christian Graus18-Nov-08 20:24
protectorChristian Graus18-Nov-08 20:24 
AnswerRe: Ajax in Asp.net Pin
smarttom9918-Nov-08 20:50
smarttom9918-Nov-08 20:50 
QuestionLock Pin
ellllllllie18-Nov-08 19:45
ellllllllie18-Nov-08 19:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.