Click here to Skip to main content
15,915,600 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: automating microsoft word file using vb.net Pin
Manas Bhardwaj29-Jun-09 1:37
professionalManas Bhardwaj29-Jun-09 1:37 
QuestionUsing SQL Search in c# page - problem with fields with ' ' in them Pin
eyeseetee29-Jun-09 1:21
eyeseetee29-Jun-09 1:21 
AnswerRe: Using SQL Search in c# page - problem with fields with ' ' in them Pin
SeMartens29-Jun-09 1:55
SeMartens29-Jun-09 1:55 
AnswerRe: Using SQL Search in c# page - problem with fields with ' ' in them Pin
DoctorMick29-Jun-09 2:02
DoctorMick29-Jun-09 2:02 
GeneralRe: Using SQL Search in c# page - problem with fields with ' ' in them [modified] Pin
eyeseetee29-Jun-09 2:20
eyeseetee29-Jun-09 2:20 
AnswerRe: Using SQL Search in c# page - problem with fields with ' ' in them Pin
SeMartens29-Jun-09 2:13
SeMartens29-Jun-09 2:13 
AnswerRe: Using SQL Search in c# page - problem with fields with ' ' in them Pin
Niladri_Biswas29-Jun-09 6:20
Niladri_Biswas29-Jun-09 6:20 
Questioncan't send mail with attachment file,that is from database Pin
pujafaldu29-Jun-09 0:39
pujafaldu29-Jun-09 0:39 
Hi...

I want to send mail through attachment class.
I want to pass stream data into it,from database with datatype image.
Here is the code....

protected void btnSendMail_OnClick(object sender, ImageClickEventArgs e)
{
MailAddress from = new MailAddress(Config.MailFrom);
MailAddress to = new MailAddress(lblToMail.Text);

MailMessage mail = new MailMessage(from, to);
mail.Subject = lblSubject.Text;
mail.Body = txtMailBody.Text;
mail.IsBodyHtml = true;
mail.Sender = from;


string strCommand = "select ID,FileName,Extension,Iszip,Content1,Image_Type,ByloginCode,OnDate from ZipFile where ID=" + iAttachmentFileCode + " ";

DataTable dt = new DataTable();
if (objDbTrans.ExecuteDataAdapter(strCommand, ref dt))
{
foreach (DataRow row1 in dt.Rows)
{

byte[] reportFile = (byte[])row1["Content1"];
string strfileName = row1["FileName"].ToString();

MemoryStream stmContent;
stmContent = new MemoryStream(reportFile);

Attachment attachFile = new Attachment(stmContent,strfileName);
mail.Attachments.Add(attachFile);

}
}
SmtpClient SmtpMail = new SmtpClient(Config.MailServerSmtp);
SmtpMail.Send(mail);
}

mail is sent with file name,nut its content is blank.
Here Content1 is the datatable field with datatype image, containg binary data.

Plz,help to solve this issue.
Thanks.

Regardds,
PUJA FALDU
AnswerRe: can't send mail with attachment file,that is from database Pin
Manas Bhardwaj29-Jun-09 0:45
professionalManas Bhardwaj29-Jun-09 0:45 
GeneralRe: can't send mail with attachment file,that is from database Pin
pujafaldu29-Jun-09 1:27
pujafaldu29-Jun-09 1:27 
GeneralRe: can't send mail with attachment file,that is from database Pin
N a v a n e e t h29-Jun-09 1:37
N a v a n e e t h29-Jun-09 1:37 
AnswerRe: can't send mail with attachment file,that is from database Pin
N a v a n e e t h29-Jun-09 1:50
N a v a n e e t h29-Jun-09 1:50 
QuestionSomething Missing Pin
KhandelwalA29-Jun-09 0:30
KhandelwalA29-Jun-09 0:30 
AnswerRe: Something Missing Pin
Christian Graus29-Jun-09 0:38
protectorChristian Graus29-Jun-09 0:38 
AnswerRe: Something Missing Pin
Manas Bhardwaj29-Jun-09 0:40
professionalManas Bhardwaj29-Jun-09 0:40 
GeneralRe: Something Missing Pin
KhandelwalA29-Jun-09 0:44
KhandelwalA29-Jun-09 0:44 
AnswerRe: Something Missing Pin
Muhammad Gouda29-Jun-09 3:10
Muhammad Gouda29-Jun-09 3:10 
QuestionSys.WebForms.PageRequestManagerServerErrorException: Pin
krishnaveer28-Jun-09 23:57
krishnaveer28-Jun-09 23:57 
AnswerRe: Sys.WebForms.PageRequestManagerServerErrorException: Pin
Ravi Mori29-Jun-09 0:13
Ravi Mori29-Jun-09 0:13 
GeneralRe: Sys.WebForms.PageRequestManagerServerErrorException: Pin
krishnaveer29-Jun-09 0:39
krishnaveer29-Jun-09 0:39 
QuestionHow to persist the focus on the panel during postback Pin
YazhiniP28-Jun-09 23:43
YazhiniP28-Jun-09 23:43 
AnswerRe: How to persist the focus on the panel during postback Pin
Christian Graus28-Jun-09 23:49
protectorChristian Graus28-Jun-09 23:49 
QuestionHow to deal with Fileupload control inside View control ? Pin
Rameez Raja28-Jun-09 23:42
Rameez Raja28-Jun-09 23:42 
AnswerRe: How to deal with Fileupload control inside View control ? Pin
Christian Graus28-Jun-09 23:50
protectorChristian Graus28-Jun-09 23:50 
GeneralRe: How to deal with Fileupload control inside View control ? Pin
Rameez Raja29-Jun-09 0:34
Rameez Raja29-Jun-09 0:34 

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.