Click here to Skip to main content
15,902,189 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: API call from VB.net Pin
Ben Fair15-Dec-08 2:02
Ben Fair15-Dec-08 2:02 
AnswerRe: API call from VB.net Pin
Thomas Stockwell17-Dec-08 5:39
professionalThomas Stockwell17-Dec-08 5:39 
QuestionConvert HTML into RTF Pin
JR21214-Dec-08 21:22
JR21214-Dec-08 21:22 
AnswerRe: Convert HTML into RTF Pin
Christian Graus14-Dec-08 21:49
protectorChristian Graus14-Dec-08 21:49 
GeneralRe: Convert HTML into RTF Pin
JR21214-Dec-08 23:11
JR21214-Dec-08 23:11 
GeneralRe: Convert HTML into RTF Pin
Dave Kreskowiak15-Dec-08 4:20
mveDave Kreskowiak15-Dec-08 4:20 
QuestionCalling webservice with forms authentication Pin
AlexeiXX314-Dec-08 16:25
AlexeiXX314-Dec-08 16:25 
Questionsend email Pin
angels77714-Dec-08 2:33
angels77714-Dec-08 2:33 
i am new to vb.net.
i would like to create a class for sending emial . i tried the script online but i failed to send.
So i got this code below from the hosting server.
May i know how do i simplify the below script to just receive
FromEmail, Subject, Message ?
why it needs the mailerpath?mailerport? and errText? isn't we can check those error in the form instead of class ?
Please kindly advice. thanks
<pre>

' **** MailerPath = Your SMTP path (for eg: mail.[domain].com) ***

function CDOSYS_Mailer(Message, FromEmail, ToEmail, FromName, ToName, Subject, MailerPath, MailerPort, errText, searchURL)
on error resume next


dim Mailer
set Mailer = server.createobject("CDO.Message")
if err.number &lt;&gt; 0 then
errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description)
CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0
exit function
end if

Mailer.From = FromName &amp; " &lt;" &amp; FromEmail &amp; "&gt;"
Mailer.To = ToName &amp; " &lt;" &amp; ToEmail &amp; "&gt;"
Mailer.TextBody = Message
Mailer.Subject = Subject
with Mailer.Configuration
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailerPath
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = MailerPort
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")="test@yourdomain.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")="youremailpassword"
.Fields.Update
end with
Mailer.Send
if err.number &lt;&gt; 0 then
errText = displayError("CDOSYS", searchURL, err.Number, err.Source, err.Description)
CDOSYS_Mailer = false : set Mailer = nothing : err.clear() : err = 0
exit function
end if
set Mailer = Nothing
CDOSYS_Mailer = true
end function</pre>
AnswerRe: send email Pin
Colin Angus Mackay14-Dec-08 4:20
Colin Angus Mackay14-Dec-08 4:20 
AnswerRe: send email Pin
LloydA11114-Dec-08 6:55
LloydA11114-Dec-08 6:55 
AnswerRe: send email Pin
Christian Graus14-Dec-08 8:29
protectorChristian Graus14-Dec-08 8:29 
GeneralRe: send email Pin
astanton197815-Dec-08 8:08
astanton197815-Dec-08 8:08 
Questionsend email Pin
angels77714-Dec-08 2:19
angels77714-Dec-08 2:19 
AnswerRe: send email Pin
Christian Graus14-Dec-08 8:29
protectorChristian Graus14-Dec-08 8:29 
AnswerRe: send email Pin
Charl14-Dec-08 20:57
Charl14-Dec-08 20:57 
QuestionEnable/Disable Modem Pin
Member 216783614-Dec-08 1:53
Member 216783614-Dec-08 1:53 
Question[Message Deleted] Pin
njote13-Dec-08 19:36
njote13-Dec-08 19:36 
AnswerRe: help me Pin
Christian Graus13-Dec-08 22:30
protectorChristian Graus13-Dec-08 22:30 
QuestionHow to open an existing excel spreadsheet using vb.net Pin
samsonx12-Dec-08 22:15
samsonx12-Dec-08 22:15 
AnswerRe: How to open an existing excel spreadsheet using vb.net Pin
Mycroft Holmes12-Dec-08 22:47
professionalMycroft Holmes12-Dec-08 22:47 
AnswerRe: How to open an existing excel spreadsheet using vb.net Pin
Dave Kreskowiak13-Dec-08 6:04
mveDave Kreskowiak13-Dec-08 6:04 
AnswerRe: How to open an existing excel spreadsheet using vb.net Pin
LloydA11113-Dec-08 7:38
LloydA11113-Dec-08 7:38 
QuestionUSB Hardware Locker Pin
JC.KaNNaN12-Dec-08 22:12
JC.KaNNaN12-Dec-08 22:12 
AnswerRe: USB Hardware Locker Pin
Dave Kreskowiak13-Dec-08 6:03
mveDave Kreskowiak13-Dec-08 6:03 
GeneralRe: USB Hardware Locker Pin
Luc Pattyn13-Dec-08 6:28
sitebuilderLuc Pattyn13-Dec-08 6:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.