|
May be you can do this:
string strAttach = string.Empty;
string strSendAttach = string.Empty;
string strFileName = string.Empty;
string strFileAttachment = string.Empty;
Stream FileStream;
bool bFlag = false;
bool bCheck = false;
HttpFileCollection hfc = Request.Files;
objMailSend.SendMailToExternalUser(ValidetEmailId, txtMailBody.Text, lblSubject.Text, hfc);
public void SendMailToExternalUser(string strToEmail, string strbody, string strSubject, HttpFileCollection PobjFileCollection)
{
MailAddress from = new MailAddress(Config.MailFrom);
MailAddress to = new MailAddress(strToEmail);
MailMessage mail = new MailMessage(from, to);
mail.Subject = strSubject;
mail.Body = strbody;
mail.IsBodyHtml = true;
mail.Sender = from;
for(int LiCount = 0; LiCount < PobjFileCollection.Count; LiCount++)
{
Attachment attachFile = new Attachment(PobjFileCollection[LiCount].InputStream, PobjFileCollection[LiCount].FileName);
mail.Attachments.Add(attachFile);
}
SmtpClient SmtpMail = new SmtpClient(Config.MailServerSmtp);
SmtpMail.Send(mail);
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hey....
Lots of Thanks..........................
as ur suggestion ,i have made changes and it works fine..
Regards,
PUJA FALDU
|
|
|
|
|
I realize this doesn't answer your code-specific question, but is zipping the files an option? It will provide better speed and reliably, and limit your attachments to a single file. You can use the System.IO.Compression class to compress the stream of files. Advantages of zipping files for email: Zip or unzip a file[^]
Regards,
Gary
|
|
|
|
|
Hi I am a c++ programmer new to ASP.NET, I am using VS 2005
I want to create a Web Form with 2 or 3 fields with save button, which can insert a
record in the ORACLE table.
Please advice good links or resource
|
|
|
|
|
Have a look here[^] for straight solution.
For more learning, this [^]would be nice.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
There are lots of samples available when you google....
|
|
|
|
|
|
Hi
Is there a way to display a DIV object on top of an ActiveX control.
I'm using Office web components and I need to display a menu bar which should be displayed on top of these(owc) controls.
Help ?
|
|
|
|
|
Did try it some ages ago, never managed to do anything with z-index, only solution was to use JavaScript to hide activex, and show it back again when div hides.
Objects have infinite z-index, this is why you can put as large z-index to div as you want, but it will not be on top.
What comes to my mind is iframe, did never try it, but, iframe is sort of an object also. Maybe you could try to change your div to iframe and see if it gets on top of activex.
|
|
|
|
|
Hi,
I am using FCK Editor in my WebPage, The content of web page is retrived from sql table,i need to edit the content and update the text in table using FCK editor. Once i edit the text(change the font color,bold the text etc) and try to update in sql table i got the below error(due to HTML tags like "strong" etc)
"A potentially dangerous request.form value was detected from the client"
I need some help to save the formatted text to sql table using FCK Editor
|
|
|
|
|
You probably need to turn off the checking that is causing that message to appear. If you have those tags in your control, I doubt there's a way around it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Or because of security reasons, better not disable checking but instead encode
data he sends.
oFCKeditor.Config['HtmlEncodeOutput']=true;
But if he did try to google it he would have found this out.
Edit:
It's funny how all this kind of posts come from India.
|
|
|
|
|
OK, I've never used the control, I assumed he'd read the docs and had no options.
Enver Maroshi wrote: It's funny how all this kind of posts come from India.
Tell me about it, did you see the guy asking over and over how to remove a printer from a list, below ? On the other hand, some of the best programmers I know, are Indian. They are not, however, in India.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yes, but i think it's got nothing to do with country they are from, maybe it's only that in India there is really a lot of people that try to be programmers, but they are missing basics, either this people did not learn to programm at all, or they did not pay attention in school. I understand this is forum for helping people, but this are basic question, like someone would ask how to write a code that will print out "yes" or "no" depending on boolean input. This people are missing basics, and they still manage to make real applications, they are copy-paste Gods
Company in which i work did work with people from India, and they ware really good (flash) programmers. So, i guess it's individuals, and i think the problem is that all good programmers from India go in states or europe, and the new guys don't have anyone that will teach them. So they try to learn from internet, and the result we can see.
I think one learns most from they coworkers.
|
|
|
|
|
Enver Maroshi wrote: lot of people that try to be programmers, but they are missing basics, either this people did not learn to programm at all, or they did not pay attention in school
How did you conclude this point ?
Enver Maroshi wrote: I understand this is forum for helping people, but this are basic question, like someone would ask how to write a code that will print out "yes" or "no" depending on boolean input.
If you looks around you will get many more basic question.
Enver Maroshi wrote: his people are missing basics, and they still manage to make real applications, they are copy-paste Gods
I think if you are going to copy paste in you real application you should need the basic idea that what you are copying and where to paste. And for that you need the basic idea .
Enver Maroshi wrote: So, i guess it's individuals, and i think the problem is that all good programmers from India go in states or europe
Not Correct ! If all the good Indian programmers work in US or Europe, then you want mean that all the MNCs in India, developing software with the Bad programmers.
Enver Maroshi wrote: and the new guys don't have anyone that will teach them. So they try to learn from internet, and the result we can see.
I think internet is the best resource from where you can learn.
|
|
|
|
|
"I think internet is the best resource from where you can learn."
I do not agree on this one. 10 years ago, maybe.
In time of blogs, etc... anyone can write what he wants, and there is large amount of blogs where you can find code, and a lot of times, its just bad. And also on CP you can find bad articles, and people start writing this kind of code, and there things go wrong way.
Internet is not what it used to be.
But since we are far away from the topic, i'm done writing.
|
|
|
|
|
Enver Maroshi wrote: But since we are far away from the topic, i'm done writin
|
|
|
|
|
Christian Graus wrote: I assumed he'd read the docs
Thats a strange assumption to make on this forum.
|
|
|
|
|
i didn't get it from you experts,
i used the below code.but it give error
FCKEditor.Config['HtmlEncodeOutput']=true;
Error: Too many characters in character literal
could you give some articles or example how to insert the formatted text into sql table and retrieves the same in same format into fckeditor
Thanka for your reply's.
|
|
|
|
|
This "none-expert" would say you have error in syntax, it is telling you that you wrot some literal character why you should have escaped (with escape character).
Hard to say without code.
|
|
|
|
|
Put HtmlEncodeOutput in double quotes.
|
|
|
|
|
Enver Maroshi wrote: It's funny how all this kind of posts come from India.
And from where you are?????
Croatia
Where it is in World Map........
If you do not like any question Mark it is Bad question..
Dont write comment about any country,religion or community
himanshu
|
|
|
|
|
Maybe it is wrong place so let's not continue this conversation regarding countries and focus on answers. I did not mean anything bad regarding people from India. What i did try to say is that you got a lot of programmers, some really good, but also some really bad. Its that you outnumber us all, you have really a lot of people, so this is why numbers are so large. Sure i could not find 3 stupid questions from people that reside in Croatia, well, since, it's only 4 millions of us
|
|
|
|
|
Did you close your eyes when many Indians are giving best answer in this forum? Why didn’t you appreciate them? Also many of the Indians become CodeProject MVP.
The number of programmers in India may be nearly equivalent of the population of your country. Therefore there might be few programmer (out of million programmers) may ask some inappropriate questions.
If you are not interested to answer a question, please stay away. Please do not underestimate people of a country.
|
|
|
|
|
dotnet buddy wrote: Did you close your eyes when many Indians are giving best answer in this forum?
There are a few indians who are prolific here, and who give good answers. That doesn't change that the people who ask the most clueless, ignorant questions, can't understand the answers, keep saying 'do the needful, it's URGENT' and so on, are nearly ALL in India.
dotnet buddy wrote: The number of programmers in India may be nearly equivalent of the population of your country.
I doubt that, VERY much. The number of Indians who CLAIM to be programmers and are not, is probably not that many.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|