|
|
|
|
![]() ![]() |
May 23 2005, 02:39 AM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 7 Joined: 22-May 05 Member No.: 5,317 |
Hi everybody,
I want to send an email to multi users through my VB application. I don't know if I can use a VB class for this case or I should download a smtp mail component. I would be thankful if you can suggest me the best solution. Please give me a code example for former solution or introduce me an effective free, permanent component. This post has been edited by microscopic^earthling: Jun 29 2005, 05:05 PM |
|
|
|
May 23 2005, 02:42 AM
Post
#2
|
|
|
Member [ Level 1 ] Group: Members Posts: 46 Joined: 23-May 05 Member No.: 5,347 |
I , myself, am not sure about this. My friend says it can be done purely through VB. I will find out more about this from her. I have doubts about your legal purposes of this program you are going to make, but oh well, it's your choice.
|
|
|
|
May 28 2005, 03:08 PM
Post
#3
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 4 Joined: 1-April 05 Member No.: 3,491 |
I'm not a huge fan of Visual Basic, but controlling an SMTP server isn't all that hard. Basically, all you need to do is connect to it, specify the sender and receipient(s), and send the message.
And also, you might want to consider posting this in the Visual Basic forum. |
|
|
|
May 28 2005, 04:33 PM
Post
#4
|
|
|
Pretty please? Group: Members Posts: 733 Joined: 28-November 04 From: Holland Member No.: 1,552 |
Using winsock is enough.
But you do need a SMTP server where you have a account from, like the smtp server of your isp since relaying is disabled in 99 out of 100 servers these days I did create a small basic smtp email proggie though, if you need the VB source i might even mail it to you if you ask nicely |
|
|
|
Jun 29 2005, 12:57 PM
Post
#5
|
|
|
Member - Active Contributor Group: Members Posts: 90 Joined: 29-June 05 Member No.: 6,693 |
You can use the Microsoft Webbrowser control in there and use PHP
|
|
|
|
Jun 29 2005, 05:01 PM
Post
#6
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
I can provide you a solution using VB.NET - I can't stand VB6 anymore..
The .NET framework provides you with a class called SmtpMail - which under normal circumstances isn't available for use with Windows forms. It's meant for ASP.NET applications and can be found in the library System.Web.Mail namespace. All you've to do to make it work in your WinForm application is include a Reference to the file, System.Web.dll. This can be done by right-clicking on References in your Project explorer and clicking Add reference. Once you've added this, use the following code to send mails out: CODE Imports System; Imports System.Web.Mail; Dim EmailTo As String 'Emailaddres for user to send Dim EmailFrom As String 'Emailaddres for user from Dim MailSubject As String 'Subject of Mail Dim MessageBody As String 'Message Dim ServerName As String 'Server Name - important ServerName = "<<Your SMTP server's Name>>" 'Similarly, add in EmailTo, EmailFrom etc parameters here EmailTo = "someone@recipient.net" EmailFrom = "me@mysqlf.net" ... ..... 'Set the SMTP Server's address SmtpMail.SmtpServer = ServerName 'This is the code that sends out the email based on whatever server information you've set 'Enclosed within Try-Catch block to catch exceptions in case of errors Try SmtpMail.Send (EmailFrom, EmailTo, MailSubject, MessageBody) Catch ex As Exception MsgBox ( "Delivery Failure: " & ex.Source & ex.Message ) End Try Hope this helps... Regards, m^e |
|
|
|
Mar 19 2008, 05:43 AM
Post
#7
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
coding in email
How To Send Email Using VB (using SMTP) ? I have to simple coding in email sending.I have use To,From,Subject, Message and Submit Button...When I send mail it will be store in my computer..I have use ASP.net with VB,VB.NET. -reply by chitar bahadur |
|
|
|
May 23 2008, 12:58 PM
Post
#8
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Replying to Feedbacker
Sub SendMail() Dim iMsg As Object Dim iConf As Object Dim Flds As Variant Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Set Flds = iConf.Fields With Flds .Item("http://schemas.Microsoft.Com/cdo/configuration/smtpusessl") = True .Item("http://schemas.Microsoft.Com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.Microsoft.Com/cdo/configuration/sendusername") = "yourmail@gmail.Com" .Item("http://schemas.Microsoft.Com/cdo/configuration/sendpassword") = "yourpassword" .Item("http://schemas.Microsoft.Com/cdo/configuration/smtpserver") = "smtp.Gmail.Com" .Item("http://schemas.Microsoft.Com/cdo/configuration/sendusing") = 2 .Item("http://schemas.Microsoft.Com/cdo/configuration/smtpserverport") = 25 .Update End With strbody = "Sample message " & Time With iMsg Set .Configuration = iConf .To = sendto .CC = "" .BCC = "" ' Note: The reply address is not working if you use this Gmail example ' It will use your Gmail address automatic. But you can add this line ' to change the reply address .ReplyTo = "Reply@something.Com" .From = "<mail to be displayed as @gmail.Com>" .Subject = "subject" .TextBody = strbody .Send End With End Sub -reply by shasunder |
|
|
|
Jun 19 2008, 11:52 AM
Post
#9
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
is it possible using MAPIMessages.
How To Send Email Using VB (using SMTP) ? Hi All, Is it possible to send mail with CC and BCC using MAPIMessages ? Thanks in advance. RK. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 07:55 AM |