15,746,420 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Adrian4263 (Top 44 by date)
Adrian4263
3-Feb-14 23:13pm
View
Thanks for your answer, but the code u giving can't work as well.
Adrian4263
31-Dec-13 3:28am
View
Thanks for your answered.I solved it already.
Adrian4263
17-Aug-13 3:39am
View
I've checked,there is no reserved words, and I've tried your above method.It doesn't work for me also. Still have any solution?Anyway thanks for your reply.
Adrian4263
14-Aug-13 4:01am
View
Thanks your reply,but it doesn't work for me.
I check many times already,there is no reserved words in my Ms Access database.
Adrian4263
7-Jul-13 22:40pm
View
Yup
Adrian4263
4-Jul-13 22:50pm
View
Is okay.You Know Do Loop?
Adrian4263
4-Jul-13 0:18am
View
I tried already, samething.
Adrian4263
3-Jul-13 21:12pm
View
Under msg got blue line, is it wrong?
Adrian4263
2-Jul-13 21:28pm
View
I've tried,IO Exception was unhandled(The process cannot access the file 'C:\......py1.pdf' because it is being used by another process.)What is the problem?
Adrian4263
2-Jul-13 5:15am
View
You know how to delete the exported files(visual basic code)? Mean I click email button,the report will export to PDF file and attach send by email.What I need is the exported files will auto deleted after my email sent out. Is that clear?You can ask me,if my question not clear.Thx
Adrian4263
29-Jun-13 4:00am
View
Now is Crystal report export to PDF files, use PDFSharp it is work?
Adrian4263
28-Jun-13 22:39pm
View
Seen its useless for me.Still have any solution?Except itextSharp.
Adrian4263
28-Jun-13 3:49am
View
Oh I see,actually I can create PDF files now,just cannot separate the page to each file.10 pages to 1 PDF files in 1 run.
Adrian4263
28-Jun-13 3:38am
View
You know what is the code? Itextsharp I never use before.
Adrian4263
28-Jun-13 2:57am
View
Actually I do not know the code for export separate PDF.I have to find it out now.
Adrian4263
28-Jun-13 2:51am
View
I did it,now what I mean is,for example: 10 people/10 pages,i want export the 10 pages to the 10 PDF files,I do not want 10 pages export into 1 PDF file.You get what I mean?Let say, now I have 3 pages need to send to 3 people,and each people will get 1 page,and now my problem is 3 pages export into 1 PDF file and sent to 3 people,that mean each people get it 3 pages.
Adrian4263
28-Jun-13 2:39am
View
Where this code should I put?
Adrian4263
27-Jun-13 0:38am
View
I've solved the Obj.Export error already.But I still have a small problem,that is PDF file,let' say 10 people,A1 to A10.I selected A1 ,come up 1 page,after that I click the email button it will export to PDF file first and attach send it out.This no problem.
If I select A1 to A3,it come up 3 pages,when I go click the email button,it should export 1 by 1 to the PDF file and send,but it wont,it combine the 3 pages in 1 PDF file.What is the problem?
Adrian4263
26-Jun-13 22:50pm
View
Okay,finally I can send the email successful.I change he port from 465 to 25.Thanks you a lot.
But I still have a problem,for example,I have 10 people can select which is A1 to A10,after I select it will come up another page,example:I selected A1 to A1,it show 1 page,if only 1 page I click the email button it can sent successful.If I select A1 to A3,then it will come up 3 page,and I go click he email button it only can send the first page go out and then come out this following error:
Obj,Export<< this line of code error "The process cannot access the file 'C:\....\...\...\py1.pdf' Because it is being used by another process.
Adrian4263
26-Jun-13 4:13am
View
How to use debugger to find the error?Now I have 0 error,I just debug the program click email button,then pop up a MsgBox("failed to send email with the following error:" + e.Message)failure sending mail replace with the e.Message.Cannot consider as error right?
Adrian4263
25-Jun-13 21:09pm
View
Should be add successful.My part 1 code is export and attach file,do you see any problem?
Adrian4263
25-Jun-13 5:57am
View
I already put the both place same email already,but it still the same,show me a msgbox >>failed to send email with the following error: Failure sending mail.
Adrian4263
25-Jun-13 5:53am
View
My credentials is
Smtp.Credentials = new NetworkCredential("adrianleong263@hotmail.com", "MyPassword"),like that can't?
Adrian4263
25-Jun-13 5:36am
View
I tried it,can't.I amend eid to ("adrian_leong90@hotmail.com") it pop up a msgbox >>failed to send email with the following error: Failure sending mail.
Adrian4263
25-Jun-13 5:14am
View
Okay,I test the code just now.
msg.From = New MailAddress(eid)<<this line pop up msg said The parameter 'address' cannot be an empty string.
Parameter name: address.
Adrian4263
25-Jun-13 5:05am
View
SmtpClient Smtp = new SmtpClient("smtp.live.com", 465) where the code should me put?
Under the Dim Smtp As New SmtpClient("Smtp.live.com", 465)?
Adrian4263
25-Jun-13 4:58am
View
("MyEmail@hotmail.com", "MyPassword") or ("MyEmail@hotmail.com" and "MyPassword")?
Then my server should write ("Smtp.live.com", 465) p/s:465 is the port.
Adrian4263
25-Jun-13 4:44am
View
Please wait for awhile,I go try again see whether can run.
In the bracket write email address and password right? ("myemail@.hotmail.com", "password") need to put "" <<this?
Adrian4263
25-Jun-13 4:35am
View
I amend part 2 code,after that I want run the program,pop up there were build error,suddenly appear 12 error come up at the other part,its under the word got red line.For example, this page code have 11 pass <<word,11 pass word got the red line under the word.
Adrian4263
25-Jun-13 4:24am
View
The following is my email button code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dsd As New DataSet
Dim sql As String = "Select * from email"
Dim cmd As New SqlCommand(sql, connect)
dAdapter.SelectCommand = cmd
dsd.Reset()
dAdapter.Fill(dsd)
If dsd.Tables(0).Rows.Count > 0 Then
Dim type = dsd.Tables(0).Rows(0).Item("type")
Dim eid = dsd.Tables(0).Rows(0).Item("id").ToString.Trim
Dim pass = dsd.Tables(0).Rows(0).Item("pass").ToString.Trim
Dim port = dsd.Tables(0).Rows(0).Item("port").ToString.Trim
Dim server = dsd.Tables(0).Rows(0).Item("server").ToString.Trim
MsgBox("start to send email ...")
For i = 0 To dSet.Tables(0).Rows.Count - 1
Dim email As String = dSet.Tables(0).Rows(i).Item("email").ToString.Trim
If email <> "" Then
Dim id As String = dSet.Tables(0).Rows(i).Item("empid").ToString
Dim CrExportOptions As New ExportOptions
Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim crformatTypeOptions As New PdfRtfWordFormatOptions()
CrDiskFileDestinationOptions.DiskFileName = _
ConfigurationManager.AppSettings("pypath")
CrExportOptions = obj.ExportOptions
crformatTypeOptions.FirstPageNumber = i
crformatTypeOptions.LastPageNumber = i
crformatTypeOptions.UsePageRange = True
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = crformatTypeOptions
End With
obj.Export()
'_________________________________________________________________________________
Dim Smtp As New EASendMailObjLib.Mail
Smtp.LicenseCode = "TryIt"
Smtp.FromAddr = eid '"ab@mail.com"
Smtp.AddRecipientEx(email, 0)
Smtp.Subject = "aabb"
Smtp.BodyText = "aabb"
'' Add attachment from local disk
If Smtp.AddAttachment(pdfFile) <> 0 Then
MsgBox("Failed to add attachment with error:" & Smtp.GetLastErrDescription())
End If
Smtp.ServerAddr = server '"smtp.gmail.com"
Smtp.ServerPort = port ' 465
'' detect SSL/TLS automatically
Smtp.SSL_init()
Smtp.UserName = eid '"ab@mail.com"
Smtp.Password = pass '"123"
If Smtp.SendMail() = 0 Then
'' MsgBox("email was sent successfully!")
Label1.Text = "1"
Else
MsgBox("failed to send email with the following error:" & Smtp.GetLastErrDescription())
End If
Else
End If
Next
If Label1.Text = "1" Then
MsgBox("email was sent successfully!")
End If
Label1.Text = ""
End If
'____________________________________________________________________________________________________________
End Sub
Adrian4263
25-Jun-13 4:12am
View
Roger,firstly, my email button code got 2 part,the part I shown above which is Part 2,just now I try the code got error, so i gonna show you the whole email button code.Hope you can help me solve the error.
Adrian4263
25-Jun-13 4:02am
View
Because the code is quite long. Is this reasonable?
Adrian4263
25-Jun-13 3:54am
View
adrian_leong90@hotmail.com this is my email, can you inbox me,I got some question to ask you.Thanks
Adrian4263
25-Jun-13 3:34am
View
Okay,I got it.I go try and see,I think this is helpful and thanks you a lot :)
Adrian4263
25-Jun-13 3:28am
View
Yup,I know it.What I mean is where should I write the sender email address and password.
Adrian4263
25-Jun-13 3:21am
View
That mean I no need write any address in the msg.From address,because those I want to send mail to them is read from database.
Smtp.Credentials = New NetworkCredential(eid, pass),so I want replace my e-mail to eid and pass?
Adrian4263
25-Jun-13 3:05am
View
Okay. msg.From = New MailAddress(eid) <<The meail address is write my e-mail address is it?And Smtp.Credentials = New NetworkCredential (eid, pass)<< my id n password replace the NetworkCredential or replace in the bracket?
Adrian4263
25-Jun-13 2:56am
View
Okay,I have a question.What server part should I write?Smtp?
Adrian4263
24-Jun-13 22:37pm
View
Do not need to use third-party library?Can Show me a simple example? Or modify my code above? Because the link you given,I'm not understand so much.Thanks
Adrian4263
18-Jun-13 21:40pm
View
Thanks a lot,I think it is helpful.
Adrian4263
18-Jun-13 21:36pm
View
Deleted
Yup
Adrian4263
17-Jun-13 23:00pm
View
Can you explain in clearly to me?I am not so understand the code that you wrote."Cpqa" is the file name right? Then what is "tbl_AF_xlsDataTDIdea"? and "cpqaAnswers"? Lets say, my file name is "excel" my table name is "excel1",then how I amend it?
Adrian4263
17-Jun-13 22:13pm
View
I've tried already,even there got 5 method,but I cannot finish the steps,because in my SQL server I cannot find the import/export data button,SSIS package..
Adrian4263
17-Jun-13 22:08pm
View
Mine one is SQL Server Management Studio Express.Is it same or different?
Show More