|
-
Oct 21st, 2007, 07:01 AM
#1
Thread Starter
New Member
Sending mail with VB 6.0
Ok,i'm trying to send mail with this library http://www.freevbcode.com/ShowCode.Asp?ID=109
Code:
Private Sub Command1_Click()
Set poSendMail = New vbSendMail.clsSendMail
poSendMail.UsePopAuthentication = True
poSendMail.ConnectTimeout = "50"
poSendMail.SMTPHost = "smtp.abv.bg"
poSendMail.SMTPPort = "25"
poSendMail.POP3Host = "pop3.abv.bg"
poSendMail.UserName = "whatever"
poSendMail.Password = "whatever"
poSendMail.From = "[email protected]"
poSendMail.FromDisplayName = "whatever"
poSendMail.Recipient = "[email protected]"
poSendMail.RecipientDisplayName = sashko
poSendMail.ReplyToAddress = "[email protected]"
poSendMail.Subject = "whatever"
poSendMail.Message = "whatever"
poSendMail.Send
Set poSendMail = Nothing
End Sub
And i'm getting the following error "Authentication failed".What cause this?Does anyone knows?Note that username,password and the SMTP and POP3 hosts are correct.I really don't know what's wrong.Sorry if that's wrong place for this thread.
-
Oct 21st, 2007, 07:25 AM
#2
Re: Sending mail with VB 6.0
Welcome to the forums. 
Are you sure Port 25 is the right port?
-
Oct 21st, 2007, 07:50 AM
#3
Thread Starter
New Member
Re: Sending mail with VB 6.0
This is from documentation of the library - "The SMTP port on the remote host. This property has a default value of 25, which conforms to the SMTP standard. Unless you are sending mail via a machine where the SMTP port was changed to a non-standard value, you don't have to set this property."
-
Oct 21st, 2007, 03:18 PM
#4
Re: Sending mail with VB 6.0
Some ISP's block port 25 as its commonly abused by apps for sending spam.
You may need to put into your app a option to enter in the desired port number that their ISP will allow in these cases. A common bypass is port 2525.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 23rd, 2007, 12:51 PM
#5
Thread Starter
New Member
Re: Sending mail with VB 6.0
Ok,there is something else,this code must be working properly but here is the problem,i tried with SMTPHost of another mail "smtp.icmail.net" and doesn't work.After that i tried with "smtp.gmail.com" of course i've changed port and other things and when i run the program i get the following message in the Status event
"Connecting to POP3 server (mail.icmail.net" and after that an error which says that the password or username is wrong.Note that i use the code below!!!!!***?What POP3 server,what "mail.icmail.net"???For second time...i'm using the posted code below.The program always tries to connect to "mail.icmail.net" I've created new project which use the same code but the same thing happens.
Last edited by cygnusX; Nov 11th, 2007 at 03:03 PM.
-
Oct 25th, 2007, 07:36 AM
#6
Re: Sending mail with VB 6.0
most of the vbsendmail settings are saved in the registry, though it appears that your code should still connect to the correct server,
put a breakpoint on the send line and test the value of smtphost and port
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 25th, 2007, 09:24 AM
#7
Re: Sending mail with VB 6.0
Some free mail services dont allow smtp connections like what vbSendMail is trying to do.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|