-
Apr 19th, 2011, 08:58 AM
#1
Thread Starter
Fanatic Member
vb6 - send email with attachment using smtp
This little project sends email with attachment, using ssl if required.
Some part of the code is not mine, but i made this for most people who still find is difficult to send email in vb6, so they can use as a template. it is simple and straight forward
SendEmail.zip
-
Apr 22nd, 2011, 06:00 AM
#2
Junior Member
Re: vb6 - send email with attachment using smtp
Tested and working! thanks man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
Jun 7th, 2011, 04:25 AM
#3
New Member
Re: vb6 - send email with attachment using smtp
Not working with me
this message
-
Jun 7th, 2011, 04:27 AM
#4
New Member
Re: vb6 - send email with attachment using smtp
i am soory
this message "the transport failed to connect the server"
-
Jun 7th, 2011, 07:53 AM
#5
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
hello,
welcome to the forums, i think you should check your
logon on credentials,
your Internet connection.
-
Jun 7th, 2011, 08:10 AM
#6
New Member
Re: vb6 - send email with attachment using smtp
thank you
but i have connection with internet
-
Jun 7th, 2011, 12:49 PM
#7
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
which email provider settings are you using
Server ?
port ?
ssl ?
-
Jun 8th, 2011, 12:40 AM
#8
New Member
Re: vb6 - send email with attachment using smtp
mailman.SmtpHost = smtp.gmail.com
mailman.SmtpPort = 465
mailman.SMTPSSL = 1
-
Jun 8th, 2011, 03:14 AM
#9
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
-
Jun 8th, 2011, 07:16 AM
#10
Frenzied Member
Re: vb6 - send email with attachment using smtp
could you post the settings reqd..
-
Jun 8th, 2011, 08:11 AM
#11
New Member
Re: vb6 - send email with attachment using smtp
Thank you very much for your support and I will give you the experience and the result
-
Jul 21st, 2011, 07:39 PM
#12
New Member
Re: vb6 - send email with attachment using smtp
many thanks for great support it is working now
-
Aug 9th, 2011, 03:57 AM
#13
New Member
Re: vb6 - send email with attachment using smtp
Hi everybody!
this project works for gmail, but it doesn't works for microsoftonline smtp server.
smtp server: smtp.mail.emea.microsoftonline.com
port: 587
with SSL
The error: -2147220973
The user and pwd are correct. I cant use them for configure client.
If I can't do it with CDO.Message, how can do it?
I'm hopeless.
Could anybody help me, please?
Thanks in advance.
Sonia.
-
Aug 9th, 2011, 02:41 PM
#14
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
Last edited by coolcurrent4u; Aug 9th, 2011 at 02:57 PM.
-
Aug 9th, 2011, 02:54 PM
#15
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
what is this error, any message with it.
-
Sep 16th, 2011, 06:11 AM
#16
New Member
Re: vb6 - send email with attachment using smtp
The error is: -2147220973 - Transport error in server conection.
I think, CDO doesn't support SSL/TLS authentication.
-
Sep 16th, 2011, 12:06 PM
#17
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
it does support ssl, this app was tested with gmail before posting. make sure that you enable pop access in your email account online first before using the app, and also make sure that you password is correct.
-
Jan 24th, 2012, 02:18 PM
#18
New Member
Re: vb6 - send email with attachment using smtp
thank you so much for the code
it works good when I run it on VB, but when I try to make an exe file it doesn't work, I get this messege
Compile Error :
Sub or Function not defined
Can you help me please !!
-
Jan 29th, 2012, 05:02 AM
#19
Junior Member
Re: vb6 - send email with attachment using smtp
Thanks
It's very good
-
Jan 29th, 2012, 12:20 PM
#20
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
@malek2610 i did get that error when i compiled, shich sub or function did it complain about?
-
Jan 30th, 2012, 12:23 PM
#21
New Member
Re: vb6 - send email with attachment using smtp
Originally Posted by coolcurrent4u
@malek2610 i did get that error when i compiled, shich sub or function did it complain about?
I've problem with "txtInfo" in :
Code:
Private Sub txtInfo_GotFocus(Index As Integer)
txtInfo(Index).SelStart = 0
txtInfo(Index).SelLength = Len(txtInfo(Index))
End Sub
-
Jan 30th, 2012, 12:39 PM
#22
Re: vb6 - send email with attachment using smtp
Do you have a control array of textboxes called txtInfo?
-
Feb 12th, 2012, 10:35 AM
#23
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
Hello, Please delete this code, its ambiguous
vb Code:
Private Sub txtInfo_GotFocus(Index As Integer)
txtInfo(Index).SelStart = 0
txtInfo(Index).SelLength = Len(txtInfo(Index))
End Sub
-
Feb 12th, 2012, 12:36 PM
#24
New Member
Re: vb6 - send email with attachment using smtp
Originally Posted by coolcurrent4u
Hello, Please delete this code, its ambiguous
vb Code:
Private Sub txtInfo_GotFocus(Index As Integer)
txtInfo(Index).SelStart = 0
txtInfo(Index).SelLength = Len(txtInfo(Index))
End Sub
Thank you so much, now it works without any problem
-
May 4th, 2012, 09:57 AM
#25
New Member
Re: vb6 - send email with attachment using smtp
you have done an outstanding job, thanks
please could you let me know how to send 3 x pdf atachments from this e-mailer
kind regards
Adie
-
Jun 22nd, 2012, 05:50 PM
#26
Re: vb6 - send email with attachment using smtp
I don't know how the rest of you got it to work but I sure don't have any luck with it. I just can't get it to work when using the server smtp.live.com. The port is at 465, Req SSL is checked, username and password are correct and my from email is correct. I always get the same error The transport failed to connect to the server
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 29th, 2012, 05:41 PM
#27
Hyperactive Member
Re: vb6 - send email with attachment using smtp
Need Help,
I have below code i want to record in each sheet only 50 data. Can anyone help me.
Private Sub print()
Dim cnn As New ADODB.Connection
Dim xlApp1 As New Excel.Application
Dim xlwk As New Excel.Workbook
Dim xlSheet1 As New Excel.Worksheet
Dim xlSheet2 As New Excel.Worksheet
Dim ctr As Long
Dim SQL As String
Dim rs
cnn.ConnectionTimeout = 15
cnn.CommandTimeout = 30
g_strDBName = dbPath & "\BarqCell Data\DSS.mdb"
'creates a new databse conection and sets the conection string
Set cnn = New ADODB.Connection
Constring = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & g_strDBName
cnn.ConnectionString = Constring
'Opens the database conection
cnn.Open
If DTPicker1.Value = "" Then
MsgBox "please select date"
Exit Sub
End If
SQL = "select number from tblWarehouse_Received where date =#" & DTPicker1.Value & "#"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open SQL, cnn, adOpenDynamic, adLockOptimistic
xlApp1.Interactive = True
Set xlwk = xlApp1.Workbooks.Open(App.Path & "\Asia.xls")
Set xlSheet1 = xlwk.Worksheets("Asia1")
xlSheet1.Select
Set xlSheet2 = xlwk.Worksheets("Sheet2")
xlSheet2.Select
xlSheet1.Range("B6").Value = Date
xlSheet2.Range("B6").Value = Date
ctr = 9 ' start data after headings
i think i made wrong in below code could you please fix it to me. so i can record only 50data in each sheet.
Do While Not rs.EOF
ctr = ctr + 1
If ctr <= 50 Then xlSheet1.Range("B" & Trim(Str(ctr))).Value = rs("number")
If ctr > 50 And ctr <= 100 Then xlSheet2.Range("B" & Trim(Str(ctr))).Value = rs("number")
rs.MoveNext
Loop
xlApp1.Visible = True
'xlwk.Save
'xlApp.Quit
'handleError:
' If err.Number <> 0 Then
' MsgBox "Error #: " & err.Number & vbCrLf & err.Description, vbCritical, "Critical Error"
' End If
End Sub
-
Jul 6th, 2012, 07:39 PM
#28
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
pls post you question the the vb6 general forum, not here
-
Jul 6th, 2012, 07:50 PM
#29
Hyperactive Member
Re: vb6 - send email with attachment using smtp
I already did. Sorry for confusing. I did post it here by mistake. Thank you for understand and your time to replay me.
-
Feb 11th, 2013, 07:48 AM
#30
New Member
Re: vb6 - send email with attachment using smtp
I am running VB6 on windows 7 ultimate with office 2010
I run the program and it gives an error:
The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
Can anybody help
-
Feb 12th, 2013, 07:21 AM
#31
Thread Starter
Fanatic Member
Re: vb6 - send email with attachment using smtp
check you connection , make sure your gmail password is correct, try it in another computer, then post the result here
-
Feb 18th, 2013, 12:22 PM
#32
New Member
Re: vb6 - send email with attachment using smtp
Works OK for Yahoo and Gmail. Errors appear if use Hotmail or Exchange. Machine used: PC with Windows 7 Enterprise, Office 2010 Pro installed and exchange used for other stuff.
-
Mar 26th, 2013, 11:09 AM
#33
New Member
Re: vb6 - send email with attachment using smtp
It works!!!!
Originally Posted by coolcurrent4u
This little project sends email with attachment, using ssl if required.
Some part of the code is not mine, but i made this for most people who still find is difficult to send email in vb6, so they can use as a template. it is simple and straight forward
-
May 1st, 2013, 08:59 PM
#34
New Member
Re: vb6 - send email with attachment using smtp
Originally Posted by coolcurrent4u
check you connection , make sure your gmail password is correct, try it in another computer, then post the result here
Have the same problem here... When i try using smtp.gmail.com, it works. But when i try using my smtp server, it failed
I've tried using the same smtp setting in my microsoft outlook, and it works. So that mean there is no problem with my setting and smpt connection
note : I use Webmail smtp
Need help please...
thanks before
-
Jan 22nd, 2014, 08:53 AM
#35
New Member
Re: vb6 - send email with attachment using smtp
I 'd like to download the sendemail.zip, but it does not work. What's wrong?
Thank you for help!
-
Mar 4th, 2014, 02:47 AM
#36
Registered User
Re: vb6 - send email with attachment using smtp
Originally Posted by coolcurrent4u
This little project sends email with attachment, using ssl if required.
Some part of the code is not mine, but i made this for most people who still find is difficult to send email in vb6, so they can use as a template. it is simple and straight forward
SendEmail.zip
cool : i try to remake on a new project, but ..
there is an error on "Dim lobj_cdomsg As CDO.Message"
and yellow highlighted "Public Function SendMail(sTo As String, sSubject As String, sFrom As String, _
sBody As String, sSmtpServer As String, iSmtpPort As Integer, _
sSmtpUser As String, sSmtpPword As String, _
sFilePath As String, bSmtpSSL As Boolean) As String"
how can i fix this ? please help me
#my_bad_english sorry
-
Mar 4th, 2014, 02:53 AM
#37
Registered User
Re: vb6 - send email with attachment using smtp
an error appears on
"Public Function SendMail(sTo As String, sSubject As String, sFrom As String, _
sBody As String, sSmtpServer As String, iSmtpPort As Integer, _
sSmtpUser As String, sSmtpPword As String, _
sFilePath As String, bSmtpSSL As Boolean) As String"
trying to remake .. but i made a function from command5_click()'s code..
and VB highlighted "Dim lobj_cdomsg As CDO.Message"
please help me
#sorry_4_my_bad_english
-
Mar 4th, 2014, 10:25 PM
#38
Lively Member
Re: vb6 - send email with attachment using smtp
Nope, try to install this
Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1
http://www.microsoft.com/en-us/downl....aspx?id=36771
-
Jun 21st, 2014, 05:15 AM
#39
Re: vb6 - send email with attachment using smtp
Thank you,
This is working for me.
I would appreciate it if someone could illustrate how to use BCC with this
Rob
-
Oct 22nd, 2014, 07:28 PM
#40
Fanatic Member
Re: vb6 - send email with attachment using smtp
Originally Posted by JackSun
I am running VB6 on windows 7 ultimate with office 2010
I run the program and it gives an error:
The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
Can anybody help
Ok I have used this code and have the same error.
using gmail, smpt.gmail.com port 465
i have used 3 machines for test, windows 7 64bit windows 8.1 64 bit, windows xp.
same error. password is correct
any ideas?
Software languages known:
Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
Software API's known:
Directx 7 and 8
Internet languages, in the process of learning:
HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|