|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
How to email from VB3
Hey im new @ VB but im making a prog where the info gets mailed to me. It's 3 text boxes named "user", "pass", "email"
and when the command button is clicked, they are emailed to me. how would i do this? |
|
#2
|
|||
|
|||
|
Please don't post without searching the forums first, searching "email" brings up many results.
OULOOK Dim objolapp As Outlook.Application Set objolapp = CreateObject("Outlook.Application") 'logon - doesn't hurt if you're already logged in & running... Dim objolns As Outlook.NameSpace Set objolns = objolapp.GetNamespace("POP3") objolns.Logon Dim objolmail As Outlook.MailItem Set objolmail = objolapp.CreateItem(olMailItem) 'fill out & send message objolmail.To = "anybody@domain.com" objolmail.Subject = "Hello World" objolmail.Body = stremail 'place your HTML body here objolmail.Send 'logoff & clean up objolns.Logoff Set objolns = Nothing Set objolmail = Nothing Set objolapp = Nothing REGULAR Function EmailCdonts(byval strAuthorEmail,byval strRecipientEmail,ByVal strCC, byval strSubject,byval strBody, ByVal intMailFormat,ByVal strAttachmentPath,ByVal intPriority) Dim ObjMail Set ObjMail = Server.CreateObject("CDONTS.NewMail") ' don't put set if you're using aspx ObjMail.FROM = strAuthorEmail ObjMail.TO = strRecipientEmail ObjMail.Cc = strCC ObjMail.Subject = strSubject ObjMail.BodyFormat = intMailFormat ObjMail.MailFormat = intMailFormat ObjMail.Body = strBody ' CdoHigh = 2 - Highest priority (Urgent) ' CdoNormal = 1 - Normal ' CdoLow = 0 - Lowest ObjMail.Importance = intPriority If strAttachmentPath <> "" Then ObjMail.AttachFile strAttachmentPath End If ObjMail.Send Set ObjMail= Nothing End Function SMTP <% Const cdoSendUsingMethod = _ "http://schemas.microsoft.com/cdo/configuration/sendusing" Const cdoSendUsingPort = 2 Const cdoSMTPServer = _ "http://schemas.microsoft.com/cdo/configuration/smtpserver" Const cdoSMTPServerPort = _ "http://schemas.microsoft.com/cdo/configuration/smtpserverport" Const cdoSMTPConnectionTimeout = _ "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" Const cdoSMTPAuthenticate = _ "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" Const cdoBasic = 1 Const cdoSendUserName = _ "http://schemas.microsoft.com/cdo/configuration/sendusername" Const cdoSendPassword = _ "http://schemas.microsoft.com/cdo/configuration/sendpassword" Dim objConfig ' As CDO.Configuration Dim objMessage ' As CDO.Message Dim Fields ' As ADODB.Fields ' Get a handle on the config object and it's fields Set objConfig = Server.CreateObject("CDO.Configuration") Set Fields = objConfig.Fields ' Set config fields we care about With Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "smtp_server_name" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPConnectionTimeout) = 10 .Item(cdoSMTPAuthenticate) = cdoBasic .Item(cdoSendUserName) = "username" .Item(cdoSendPassword) = "password" .Update End With Set objMessage = Server.CreateObject("CDO.Message") Set objMessage.Configuration = objConfig With objMessage .To = "Display Name <email_address>" .From = "Display Name <email_address>" .Subject = "SMTP Relay Test" .TextBody = "SMTP Relay Test Sent @ " & Now() .Send End With Set Fields = Nothing Set objMessage = Nothing Set objConfig = Nothing %> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How to email from VB3 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|