Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > email sample in Classic VB


Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2007, 10:39 PM
yyiiyyii yyiiyyii is offline
Newcomer
 
Join Date: Sep 2007
Posts: 8
Default email sample in Classic VB


is there a sample how to specify a password for a smtp server using classic VB? if so please post it here or a link to it here
Reply With Quote
  #2  
Old 12-11-2007, 11:08 PM
the master's Avatar
the master the master is offline
Tachikoma
 
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
Default

Im not sure i understand. Are you making your own mail server? Do you want to change the admin password programatically on another mail server? Do you want to know how to login to a mail server?
__________________
"That which seems simple is often overlooked" ~ me
Halloween Special FX
Web Hosting from Spook Technologies
Reply With Quote
  #3  
Old 12-12-2007, 12:09 AM
yyiiyyii yyiiyyii is offline
Newcomer
 
Join Date: Sep 2007
Posts: 8
Default

no, i want to send email from within my VB application, I can not find a sample where i can specify a password, my mail server requeires authenication when sending mail
Reply With Quote
  #4  
Old 12-12-2007, 12:47 AM
the master's Avatar
the master the master is offline
Tachikoma
 
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
Default

Ok, how are you trying to send the email?
__________________
"That which seems simple is often overlooked" ~ me
Halloween Special FX
Web Hosting from Spook Technologies
Reply With Quote
  #5  
Old 12-12-2007, 12:47 PM
dcalvo1 dcalvo1 is offline
Centurion
 
Join Date: Feb 2002
Location: Ohio, USA
Posts: 104
Default

I use CDO to send emails

Code:
Public Sub SendEmail(strTo As String, strFrom As String, strSubject As String, strMsg As String, strAttachPath As String) Dim iMsg As New CDO.Message Dim iConf As New CDO.Configuration Dim Flds As ADODB.Fields On Error GoTo errorhandler Screen.MousePointer = vbHourglass Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "smtp.smtpserver.com" .Item(cdoSMTPConnectionTimeout) = 10 .Item(cdoSMTPAuthenticate) = 0 .Item(cdoSendUserName) = "USERID" .Item(cdoSendPassword) = "PASSWORD" .Item(cdoURLProxyServer) = "yourproxyserver:80" .Item(cdoURLProxyBypass) = "<local>" .Item(cdoURLGetLatestVersion) = True .Update End With With iMsg Set .Configuration = iConf .To = strTo .From = strFrom .Subject = strSubject .TextBody = strMsg If strAttachPath <> "" Then .AddAttachment strAttachPath End If .Send If Err.Number <> 0 Then MsgBox "CDO Send error: " & "&H" & Hex$(Err.Number) & vbNewLine _ & Err.Description, vbOKOnly Or vbExclamation, App.EXEName End If End With Set Flds = Nothing Screen.MousePointer = vbNormal Exit Sub errorhandler: MsgBox "Error " & Err.Number & ": " & Err.Description Err.Clear Screen.MousePointer = vbNormal End Sub
Reply With Quote
  #6  
Old 12-12-2007, 02:19 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,396
Default

__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->