Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> How To Send Email Using VB (using SMTP) ?, best way to send email in vb
connectpal
post May 23 2005, 02:39 AM
Post #1


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
IcedMetal
post May 23 2005, 02:42 AM
Post #2


Member [ Level 1 ]
Group Icon

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.
Go to the top of the page
 
+Quote Post
Spectre
post May 28 2005, 03:08 PM
Post #3


Newbie [ Level 1 ]
Group Icon

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.
Go to the top of the page
 
+Quote Post
jipman
post May 28 2005, 04:33 PM
Post #4


Pretty please?
Group Icon

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 tongue.gif

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 wink.gif
Go to the top of the page
 
+Quote Post
runefantasy
post Jun 29 2005, 12:57 PM
Post #5


Member - Active Contributor
Group Icon

Group: Members
Posts: 90
Joined: 29-June 05
Member No.: 6,693



You can use the Microsoft Webbrowser control in there and use PHP smile.gif
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Jun 29 2005, 05:01 PM
Post #6


PsYcheDeLiC dR3aMeR
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post Mar 19 2008, 05:43 AM
Post #7


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post May 23 2008, 12:58 PM
Post #8


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post Jun 19 2008, 11:52 AM
Post #9


Newbie [ Level 1 ]
Group Icon

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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Code To Send An Email From A Form(10)
  2. Servers For Gmail ?(6)
  3. Send Mail Through Outlook Express(7)
  4. Funny Email Quizzes(5)
  5. Failed Sending Email :: PHP ::(8)
  6. Create And Email PDF File 'On The Fly' With PHP(1)
  7. iPod Help(8)
  8. Imho, You'll Be Rotfl!(12)
  9. Free Email Forwarding Service?(5)
  10. Want To Create A Community Website(4)
  11. Dell Computer "shuts Down" When Opening Email(31)
  12. Php Send Mail Through Smtp(8)
  13. Best Email Client For Gmail(9)
  14. SMTP Access?(3)
  15. PHP: Need Help Sending Mail Using SMTP(5)
  1. How Do I Send SMS To Mobiles Through My Site(9)
  2. Gmail As Smtp(12)
  3. Which Email Address Do You Like The Best?(26)
  4. Send Php Variable To Javascript(5)
  5. What Email Client?(10)
  6. Help - Setting Up Email(9)
  7. Make A Wish And It'll Come True...if....(6)
  8. Filtering Out Unwanted Junk Mail Using Regular Expression.(0)
  9. Email Problems(5)
  10. Friends Can't Start The Exe Files I Send :((3)
  11. Php Location Header No Send Session Id ?(0)
  12. Send Email Remotely(14)
  13. Email Certificate Issue(0)


 



- Lo-Fi Version Time is now: 6th October 2008 - 06:07 PM