I have created a form in vb.net, where the user supplies thier name, thier
email address, and thier comments. I want to create an email message and send
the information the user supplies to me when the user clicks the submit
button on the VB form. How do I do this, making the process as automated for
the user as possible Are there examples somewhere that I can study
email address, and thier comments. I want to create an email message and send
the information the user supplies to me when the user clicks the submit
button on the VB form. How do I do this, making the process as automated for
the user as possible Are there examples somewhere that I can study

are there any examples i can follow?
Arkman5
http://www.freevbcode.com/ShowCode.asp ID=6401
Melapower3000
Much as I prefer to encourage people to look stuff up for themselves, I looked it up for you:
smtp.mail.yahoo.com
Of course, you need to provide a valid username/password to validate your right to use the server, or it will fail.
Vadmyst
PhilJComputerGuy
I have not found an example where a userName/Password is specified
Thanks
Shawn
TheMasterofHitenMitsurugi
seva0412
the error mesage:
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040211): The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at Horizons_Without_Boundries.FrmFeedBack.SubmitButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\Horizons Without Boundries\Form5.vb:line 122
the code to the button click :
Private Sub SubmitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SubmitButton.Click
Dim email As New System.Web.Mail.MailMessage
Try
email.To = "mcsdhunter@yahoo.com"
email.Priority = Web.Mail.MailPriority.Normal
email.From = "mcsdhunter@yahoo.com"
email.Body = Me.RichTextBox1.Text
email.Subject = "Application Issue"
email.BodyFormat = Web.Mail.MailFormat.Text
email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "userid") 'your username goes here
email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'your password goes here
System.Web.Mail.SmtpMail.SmtpServer = "smtp.mail.yahoo.com"
System.Web.Mail.SmtpMail.Send(email)
MsgBox("email sent successfully", MsgBoxStyle.Information)
Catch ex As System.Web.HttpException
RichTextBox1.Text = ex.ToString
Finally
End Try
End Sub
- Pascal -
bool007
James K
Private Sub SubmitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SubmitButton.Click Dim email As New System.Web.Mail.MailMessage Try
email.To = "mcsdhunter@yahoo.com"
email.From = "mcsdhunter@yahoo.com"
email.Body =
Me.RichTextBox1.Textemail.Subject = "Application Issue"
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "http://us.f329.mail.yahoo.com"
System.Web.Mail.SmtpMail.Send(email)
Catch ex As System.Web.HttpExceptionMsgBox(ex.ToString)
End Try
End SubMarkShep
thanks
shawn
Test Uzer
Every user is going to have their own SMTP server, based on who they connect through. You can't anticipate or discover this, you need to ask for it, then store it so they don't have to enter it every time.