Hello guys, I'm developing a mailing application where I want to deliver my mails to a relay SMTP server. (This is a linux postfix server which is configured for outgoing performance). So in my app I just use the smtpclient to connect to this server and send the messages. Now I really would like to retrieve the message ID once I send a message. I can't find where I can retrieve this. It's sent back by the server like: 250 OK id=1K4Md1-0004B5-NO The client just returns me a boolean. Thanks !
Nick De Decker
Posts
-
Get message ID from smtp message -
Copy data between databases [modified]Hi, I've spent hours trying to copy data from a table in database A to a similar table in database B. My code doesn't return any errors but I simply don't get any rows in my db. Can someone tell me how to do this ? I'm using mysql as database.
Dim CnERP As MySql.Data.MySqlClient.MySqlConnection = Febelfin.Administratie.Propertys.DatabaseConnectie Dim CnSite As New MySql.Data.MySqlClient.MySqlConnection CnSite.ConnectionString = "Database=databaseB;Data Source=host;User Id=nick; Password=test" 'databaseconnectie was predefined ... Dim Cmd As New MySql.Data.MySqlClient.MySqlCommand Cmd.CommandText = "SELECT * FROM opleiding WHERE opl_publiceren=1" Cmd.Connection = CnERP Dim DTerp, DTsite As New DataTable Dim AdaptErp As New MySql.Data.MySqlClient.MySqlDataAdapter(Cmd) AdaptErp.Fill(DTerp) Cmd.Connection = CnSite Dim Cmd2 As New MySql.Data.MySqlClient.MySqlCommand Cmd2.CommandText = "SELECT * FROM opleiding_nick" Cmd2.Connection = CnSite Dim adaptSite As New MySql.Data.MySqlClient.MySqlDataAdapter(Cmd2) adaptSite.Fill(DTsite) Dim CBsite As New MySql.Data.MySqlClient.MySqlCommandBuilder(adaptSite) For Each dr As DataRow In DTerp.Rows DTsite.ImportRow(dr) dr.SetAdded() dr.AcceptChanges() Next DTsite.AcceptChanges() CnSite.Open() adaptSite.Update(DTsite) CnSite.Close() DTsite.AcceptChanges()
.... so i've tried a lot, but nothing seems to work. I'm probably forgetting something. How come it does not insert the rows in the destination db ? thanks ! -- modified at 5:22 Tuesday 6th November, 2007 -
Print of pdf file to network printer failsHello all, Heard some great stuff about the code project so I decided to join the community and hope to be able to help others in the future as well. Not yet there though since i'm fairly new to vb.net Anyway: I need to print PDF files that are on disk to a network printer. I searched for some printing code on the net and found several similar approaches. However printing only seems to work to local printers, not network printers. Even on local printers it sometimes fails. I used the following code: Dim PD As New System.Drawing.Printing.PrintDocument Dim DefPrint As String = PD.DefaultPageSettings.PrinterSettings.PrinterName PD.DefaultPageSettings.PrinterSettings.PrinterName = .PrinterNaam Dim NP As New Process() NP.StartInfo.FileName = "c:\test.pdf" NP.StartInfo.WindowStyle = ProcessWindowStyle.Hidden NP.StartInfo.Verb = "Print" NP.Start() NP.WaitForExit(9000) If Not NP.HasExited Then NP.Kill() End If PD.DefaultPageSettings.PrinterSettings.PrinterName = DefPrint any way to improve this piece of code ? it launches the print command to acrobat, but maybe there is a better trick to do the printing. How comes this doesn't work for network printers ? Thanks in advance, Nick