|
|
try using MessageBox.Show. Be very careful of the uppercase/lowercase combination.
Keshav Kamat
India
|
|
|
|
|
Hi!
I want to send a mail via a Microsoft Exchange Server. Does anybody know how I can realize it?
regards
spotl
|
|
|
|
|
There are several interfaes you can use to connect to an Exchange server:
- WebDAV
- Outlook automation
- MAPI / CDO 1.21
- CDOEx / ADO
- the .NET-Classes in System.Web.Mail
WebDAV is easy to implement and seems to be very reliable. You can find a lot of example code with the Google newsgroups search.
Outlook or MAPI require Outlook to be installed and configured on every local machine.
CDOEx works only on the machine that runs an Exchange server and hosts the mailbox profile you want to use.
System.Web.Mail requires a cdosys.dll which is usually (but not always) installed together wich Outlook.
I recommend you get some sample code for WebDAV. System.Web.Mail or Outlook automation may be easier to implement, but they depend on additional client software on the local machine. WebDAV uses only HTTP, so it will work on every machine.
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Hi,
Using System.Net.Mail class in .NET 2.0\
using System.Net.Mail;
{
string mailFrom = "abc@cdf.com"//From address goes here
string mailTo = "xyz@klm.com"//To address goed here
MailMessage mailMessage = new MailMessage(mailFrom, mailTo);
mailMessage.Subject = "Test";//Your mail Subject goes here
mailMessage.Body = "This is just a test";//Your mail body goes here
mailMessage.Priority = MailPriority.Normal;
string server = "SMTPServer Name goes here";
SmtpClient client = new SmtpClient(server);
//Send the email
client.Send(mailMessage);
}
|
|
|
|
|
Thank you for your help, but I want to send a mail via Exchange Server and not via Smtp Server. Sending a mail via Smtp does already work
regards
spotl
|
|
|
|
|
private void EnterTIR( string myMSEL, int myPTNumber, int myEntryOrder, int myPTSUBNr )<br />
{<br />
<br />
string url = "../TCAIMS/Forms/NewTir.aspx?MSEL='"+ myMSEL.ToString() +"'&PTNumber=" + myPTNumber.ToString()+"&EntryOrder="+ myEntryOrder.ToString()+"&PTSUBNr="+ myPTSUBNr.ToString()+"&UID='"+LoginID.Text+"'";<br />
string windowName = "NewTir";<br />
<br />
<br />
string openParams = "width=700,height=800,toolbar=1,resizable=1";<br />
StringBuilder sb = new StringBuilder();<br />
sb.Append("<script language=\"javascript\" type=\"text/javascript\">" + Environment.NewLine);<br />
sb.Append("window.open('" + url + "', '" + windowName + "','" + openParams + "');");<br />
sb.Append("</script>");<br />
Page.RegisterStartupScript("openWindowScript", sb.ToString()); <br />
<br />
<br />
}
It just wont open my window, the debugger steps through it all.
|
|
|
|
|
Okay, after I removed my varibles at the end of my stringurl, it functioned, am I writing something wrong hterE?
|
|
|
|
|
Do you really want the apostrophes around the values in the query string? They will end up as part of the value when you read the values from the query string.
If any of the values in the query string may contain any characters that has a special mening in an url, they have to be url encoded (using the Server.UrlEncode method).
If you really want the apostrophes in the values, you have to encode them as \' when putting the url in the Javascript string, otherwise the first apostrophe in the url will end the string.
And on a side note: Why on earth are you using string concatenation when you have a StringBuilder? Use the Append method to add each string to the StringBuilder instead of first concatenating strings and then adding them.
sb.AppendLine("<script language=\"javascript\" type=\"text/javascript\">");
sb.AppendLine("window.open('").Append(url).Append("','").Append(windowName).Append("','" ).Append(openParams).Append("');");
sb.Append("</script>");
---
single minded; short sighted; long gone;
|
|
|
|
|
I did use string bulider. Do I need to use string bulider to bulid the url string?
|
|
|
|
|
"String bulider does not contain a defination for appendline."
|
|
|
|
|
Right. That is only available in framework 2.0.
Use .Append(...).Append(Environment.NewLine) instead.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ibuprofen wrote: I did use string bulider.
Yes, but you used string concatenation to create strings to add to the StringBuilder. There is no reason to create the intermittent strings as you can add each string directly to the StringBuilder.
Ibuprofen wrote: Do I need to use string bulider to bulid the url string?
You don't have to use a StringBuilder at all if you don't want to.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa, as I test this, I will let you know if it works. I just wanted to say Thank you, you are the first person to ever give me a decent response on code project.
|
|
|
|
|
I never did get this to work, however, I just used a Session Variable.
Thanks for your time Guffa!
|
|
|
|
|
Hi
I am doing design document update for my code, I am in need of putting class diagram and class description. I could able to create class diagram from VS studio, but i am not able generate class descriptions (like variable_name type modifier description) for all the variables,properties and functions. I can able to see those details by right click on the class diagram and class view details, but it is not allowing me to copy all the details at a time. But i am able to copy one at a time. Is there any simple way to get all class description as like as shown in class details window. (I am working in C#). so that i can copy and paste it in the document. ( i very much required this, because i have 100s of classes and its variables
thanks
srini
|
|
|
|
|
hello.... i wanted to read an image from a scanner into a picture box using c#, but am kindof afraid of port programing. would any one plz help me in doing so
thankyou
haseeb
|
|
|
|
|
You might see if the scanner you are targeting has API commands that can be called from the .NET program.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
it supports twain. i believe that it can be called but how to call it, i don't know and how am i gonna see if its api commands can be called from .net or not..
haseeb
|
|
|
|
|
Google It
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I am working in the compact framework.
I have an ATL/COM library that creates a bitmap. I need to pass the bitmap to a C# program and display it. We have tried creating the bitmap in C# with GDI methods then used the APIs for CompatibleDCs, selectobject, getHdc, etc and passed the DC to the ATL object. On returning it from the ATL object I get ExceptionHandling errors relating to memory when I try to get a bitmap I can use in managed code. We have been able to pass the DeviceContext and draw directly on it but I want to retrieve a bitmap that I can cache as a member variable in my class.
Has anyone successfully passed bitmaps back and forth between managed and unmanaged code?
|
|
|
|
|
when i run my C#.net windows form means the following error is display.
"The type or namespace name 'keys' could not be found (are you missing a using directive or an assembly reference?)"
how to clear this error?
|
|
|
|
|
Someplace in your code you either have using keys or in the code you have keys.
You need to provide a reference to the dll that the keys namespace / object exists.
Go to references right click and add a reference.
Or remove the code that has keys in it if it is not needed.
Ben
|
|
|
|
|
Remember that C# is case-sensitive. You have to write Keys if you're referring to the framework's built-in class.
|
|
|
|
|
Hi,
I have already made this but i just cant do it again!! I'm missing something.....
What do i need to do in order to have a ok button to close a form?
What i have done was:
- Create a button in a form and give it a name (btnOk)
- Go to form properties and select btnOk in AcceptButton property
What do i need to do more?
Thx,
Nuno
|
|
|
|