-
Apr 10th, 2008, 03:51 AM
#1
Thread Starter
Junior Member
How to send mail using vbsendmail.dll and smtp.gmail.com
Hello,
I can send mail using smtp.gmail.com in vb.net. Recently i found vbsendmail.dll. But i can't send mail using smtp.gmail.com using vbsendmail.dll.
It gives me an error: 530 Must StartTls command first.
How to fix it. How can i send mail in visual basic 6 using smtp.gmail.com
I used both username and password correctly. Please help me.
Kindest regards...
Shaoun
-
Apr 11th, 2008, 08:28 AM
#2
Addicted Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
did you try winsock control to send an email?
-
Apr 11th, 2008, 08:43 AM
#3
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Im confused. You are first stating that you're using VB.NET, but then you ask how to send a mail in VB6?
Think yourself of being in our situation, do you think you've supplied us with enough information to solve your problem?
-
Apr 11th, 2008, 11:28 PM
#4
Thread Starter
Junior Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello,
I can send mail in vb.net but i need to send mail in visual basic 6. I tried winsock in vb 6 and it returns an error i mentioned above. I used smtp.gmail.com as SMTP Server and 465 as port number. Please help me.
It seems to me that i need to start ssl connection. but is it possible in vb 6.
-
Apr 12th, 2008, 06:06 AM
#5
Thread Starter
Junior Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello,
Now, i can understand the problem. Many server now requires SSL Connection. Now, my question is how to integrate SSL with Winsock. I want to send mail using winsock control and smtp.gmail.com
That is why i need to integrate with my winsock control. Please help with code.
-
Apr 15th, 2008, 04:34 AM
#6
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by shaoun1000
Hello,
Now, i can understand the problem. Many server now requires SSL Connection. Now, my question is how to integrate SSL with Winsock. I want to send mail using winsock control and smtp.gmail.com
That is why i need to integrate with my winsock control. Please help with code.
Hi,
is your problem Resolved? If so Please send me the code to send mail from Vb using smtp.gmail.com
[Email address removed by moderator]
-
Apr 15th, 2008, 02:59 PM
#7
Thread Starter
Junior Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello Kiran,
It's too difficult to resolve the problem. As most of the popular smtp server use ssl encryption and visual basic 6 has no such option. But .net has default ssl installed and you can easily send mail using vb.net. If u want the code i can provide you here. I am still trying to create a solution for visual basic 6. But it is really too difficult. Sometimes almost impossible.
Kindest regards...
Shaoun
-
Apr 16th, 2008, 12:26 AM
#8
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello Shaoun,
Thanks for your quick Reply. I have .net codeto send the mail with smtp.gmail.com. But, my requirement is to send mail using Vb and any free smtp server only. Please let me know once you get it.
Thanks & Regards,
Kiran Kumar Chandaka.
-
May 23rd, 2008, 07:22 AM
#9
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Instead of using vbsendmail.dll try using this code to send mail using gmail in vb6. it works good for me
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") = "yourpasswordhere"
.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 = "Your Sample message "
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 = "<your mailid to be displayed as@gmail.com>"
.Subject = "subject here"
.TextBody = strbody
.Send
End With
End Sub
-
May 26th, 2008, 01:25 AM
#10
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by shasunder
Instead of using vbsendmail.dll try using this code to send mail using gmail in vb6. it works good for me
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") = "yourpasswordhere"
.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 = "Your Sample message "
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 = "<your mailid to be displayed as@gmail.com>"
.Subject = "subject here"
.TextBody = strbody
.Send
End With
End Sub
Hi,
The above code is giving me the following error,
Run-time error '-2147220973 (80040213)':
The transport failed to connect to server
please let me know cause and how to rectify it....
Thanks & Regards,
Kiran
-
May 26th, 2008, 07:39 AM
#11
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Did you try using gmail or other mail ?
-
May 26th, 2008, 07:44 AM
#12
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by shasunder
Did you try using gmail or other mail ?
Thank you for your reply. I tried using "smtp.gmail.com" and on different port no.s 25, 465, 587 as listed in gmail help site. but it didn't work on any of the ports...
-
May 27th, 2008, 04:40 AM
#13
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
I am sorry and I really dont know why that issue is raising. It works fine for me and I tested this in other machines. it works fine. Since I am not able to duplicate the issue I cannot find the exact solution. Let me try to identify the cause of the issue and will let you know on the solution.
-
May 27th, 2008, 05:34 AM
#14
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by shasunder
I am sorry and I really dont know why that issue is raising. It works fine for me and I tested this in other machines. it works fine. Since I am not able to duplicate the issue I cannot find the exact solution. Let me try to identify the cause of the issue and will let you know on the solution.
Hi,
Thank You very much for your reply. I will be waiting for your next reply with solution...
-
May 28th, 2008, 06:56 AM
#15
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Could you please mention the OS that you use. whether you tried in Windows XP or some other OS?
-
May 28th, 2008, 07:16 AM
#16
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by shasunder
Could you please mention the OS that you use. whether you tried in Windows XP or some other OS?
I tried on both Windows XP and Windows 2000. But its giving me the same above error on both.
-
Aug 9th, 2008, 04:07 PM
#17
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Greetings...
This code will work smoothly
vb Code:
<%
On Error Resume Next
Dim Subject, Body, SenderEmail, RecipientEmail, SMTPServer, SMTPusername, SMTPpassword
SenderEmail = "Your Name <youremail>"
SMTPserver = "smtp.gmail.com"
SMTPusername = "your full email address"
SMTPpassword = "your password"
Subject = "Hello"
Body = "This is a test. Please ignore."
RecipientEmail= "any email address"
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "smtpusessl") = True
.Item(sch & "smtpserver") = SMTPserver
.Item(sch & "sendusername") = SMTPusername
.Item(sch & "sendpassword") = SMTPpassword
.Item(sch & "smtpserverport") = 465
.Item(sch & "sendusing") = 2
.Item(sch & "connectiontimeout") = 100
.update
End With
Const cdoSendUsingPickup = "c:\inetpub\mailroot\pickup"
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
cdoMessage.From = SenderEmail
cdoMessage.To = RecipientEmail
cdoMessage.Subject = Subject
cdoMessage.TextBody = Body
cdoMessage.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
end if
%>
-
Aug 9th, 2008, 04:54 PM
#18
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello and welcome to vbforums.
Correct me if Im wrong, but isnt that vbscript?
-
Aug 9th, 2008, 05:09 PM
#19
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Thank you Atheist, and i hope i will be usefull here
And yes it's a vbscript, the guys above were searching for anything will send an email using the gmail smtp either than .Net, so here it is, it can be used in an .asp file or vb6 application.
kiran9866650520 already posted the solution but he had a mistake with the port number.
-
Aug 9th, 2008, 08:25 PM
#20
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
You don't need to fiddle with those godawful schema strings as shown above. Just set a reference to the proper library (since you really want early binding anyway) and you have proper named constants for all of them at your fingertips.
In VB you can use the bang (!) syntax to shorten the typing even a hair more.
Instead of the clunky:
Code:
With cdoConfig.Fields
.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") = "yourpasswordhere"
.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") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/connectiontimeout") = 100
.Update
End With
You can simply write:
Code:
With cdoConfig.Fields
!cdoSMTPUseSSL = True
!cdoSMTPAuthenticate = cdoBasic
!cdoSendUserName = "yourmail@gmail.com"
!cdoSendPassword = "yourpasswordhere"
!cdoSMTPServer = "smtp.gmail.com"
!cdoSendUsingMethod = cdoSendUsingPort
!cdoSMTPServerPort = 465
!cdoSMTPConnectionTimeout = 100
.Update
End With
If the code is to be VBScript, it's a question of your script host. For WSH you can write the script as a .WSF instead of a naked .VBS file, which also allows you to specify a reference to the CDO library and get those handy named constants. For ASP you can put the reference in global.asa to gain the same thing. Of course you're still stuck with late binding.
Since you have no bang operator though, you'll need to spell out the full .Item(x) syntax, using the constants for x as appropriate:
Code:
With cdoConfig.Fields
.Item(cdoSMTPUseSSL) = True
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "yourmail@gmail.com"
.Item(cdoSendPassword) = "yourpasswordhere"
.Item(cdoSMTPServer) = "smtp.gmail.com"
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 465
.Item(cdoSMTPConnectionTimeout) = 100
.Update
End With
Maybe the funniest thing is the idea that .Net can do this! The equivalent in the .Net Framework namespaces is a COM-interop wrapper over exactly this same CDO for Windows library. Hah.
-
Jan 30th, 2009, 05:33 PM
#21
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by bachir8k
Greetings...
This code will work smoothly
vb Code:
<%
On Error Resume Next
Dim Subject, Body, SenderEmail, RecipientEmail, SMTPServer, SMTPusername, SMTPpassword
SenderEmail = "Your Name <youremail>"
SMTPserver = "smtp.gmail.com"
SMTPusername = "your full email address"
SMTPpassword = "your password"
Subject = "Hello"
Body = "This is a test. Please ignore."
RecipientEmail= "any email address"
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "smtpusessl") = True
.Item(sch & "smtpserver") = SMTPserver
.Item(sch & "sendusername") = SMTPusername
.Item(sch & "sendpassword") = SMTPpassword
.Item(sch & "smtpserverport") = 465
.Item(sch & "sendusing") = 2
.Item(sch & "connectiontimeout") = 100
.update
End With
Const cdoSendUsingPickup = "c:\inetpub\mailroot\pickup"
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
cdoMessage.From = SenderEmail
cdoMessage.To = RecipientEmail
cdoMessage.Subject = Subject
cdoMessage.TextBody = Body
cdoMessage.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
end if
%>
Hi,
I Tried using the above code in my application but its again givving some error saying " The transport failed to connect to Server "
-
Jan 30th, 2009, 08:09 PM
#22
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Ok guys, this is a new code i am working with now, its more better because even hotmail will put your email in the inbox and not in the junk.
Code:
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "youremail@gmail.com"
Flds.Item(schema & "sendpassword") = "yourpassword"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "info@bachir.com"
.From = "Bachir El Charif <info@bachir.com>"
.Sender = "Bachir.com"
.ReplyTo = "info@bachir.com"
.Subject = "A message from Bachir."
.HTMLBody = "This is a html email, please ignore"
.Organization = "Bachir"
Set .Configuration = iConf
SendEmailGmail = .Send
End With
set iMsg = nothing
set iConf = nothing
set Flds = nothing
in either way you should be aware that your email will be from youremail@gmail.com even if you have entered a different value for the from parameter.
if you want your client to receive an email from your website email address, you should configure your website and create a google webmail application for your website, but you should have all access on your domain configuration such as DNS Records.
good luck
Last edited by bachir8k; Jan 30th, 2009 at 08:13 PM.
-
Feb 1st, 2009, 03:48 AM
#23
Thread Starter
Junior Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Ok. It is no more a standard thing to use CDO object for sending mails. I forgot vb6 and transferred to vb.net 2. Here is a extensive class (Mailmessage class) that works perfectly with all email client.
Thanks.
-
Apr 20th, 2009, 03:40 AM
#24
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Originally Posted by bachir8k
Ok guys, this is a new code i am working with now, its more better because even hotmail will put your email in the inbox and not in the junk.
Code:
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "youremail@gmail.com"
Flds.Item(schema & "sendpassword") = "yourpassword"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "info@bachir.com"
.From = "Bachir El Charif <info@bachir.com>"
.Sender = "Bachir.com"
.ReplyTo = "info@bachir.com"
.Subject = "A message from Bachir."
.HTMLBody = "This is a html email, please ignore"
.Organization = "Bachir"
Set .Configuration = iConf
SendEmailGmail = .Send
End With
set iMsg = nothing
set iConf = nothing
set Flds = nothing
in either way you should be aware that your email will be from youremail@gmail.com even if you have entered a different value for the from parameter.
if you want your client to receive an email from your website email address, you should configure your website and create a google webmail application for your website, but you should have all access on your domain configuration such as DNS Records.
good luck
Nice example but do you have an example not using only gmail? Like for example I have this configuration on my outlook:
STMTP Server: mail.mywebsite.com
SMTP Port: 25
DNS Server: 123.123.123.123
Pop3 Server: mail.mywebsite.com
POP3 Port: 110
Username: myusername
password: mypassword
How do I configure this one? And also how to attach a file?
Last edited by shyguyjeff; Apr 20th, 2009 at 06:45 AM.
-
Apr 20th, 2009, 10:18 AM
#25
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
hi shyguyjeff
Code:
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "mail.mywebsite.com"
Flds.Item(schema & "smtpserverport") = 25
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "myusername"
Flds.Item(schema & "sendpassword") = "mypassword"
Flds.Item(schema & "smtpusessl") = 0
in some cases the username should be a valid email account under your domain ex: "sender@mywebsite.com" so it will not work if you just use "sender"
and to attach a file use this within "With iMsg":
.AddAttachment "c:\bachir.txt"
-
Apr 20th, 2009, 11:15 PM
#26
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
In my case i have DNS Server, Pop3 Server and Pop3 port. I try to use my smtp server only but it will not send. There is a message saying "The transport failed to connect to the server".
-
Apr 21st, 2009, 05:47 PM
#27
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
POP3 is an incoming mail server and not outgoing and you should use SMTP in order to send mails, some servers configurations require authentication in order to use the SMTP, or else anyone can use your server ip's to send mass mailing. Usually the authentications are the same as the pop3 accounts.
Concerning the DNS, there is no need to use it, as your domain name is already configured to be redirected to your hosting account with the pre-configured name servers ex: ns1.pixels-lab.com, ns2.pixels-lab.com.
but i guess in your case your server is configured only to send emails from the same ip (within your website), and it don't need any authentication.
try this:
Code:
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "mail.mywebsite.com"
Flds.Item(schema & "smtpserverport") = 25
Flds.Item(schema & "smtpauthenticate") = 0
Flds.Item(schema & "sendusername") = "myusername"
Flds.Item(schema & "sendpassword") = "mypassword"
Flds.Item(schema & "smtpusessl") = 0
Let me know if it will work.
-
Apr 22nd, 2009, 07:48 AM
#28
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Still it doesn't work... I tried it and it say "The server rejected one or more recipient addresses. The server response was 553 Sorry, that domain isn't in my list of allowed rcphosts." ..Why it is still not sending. My Outgoing Port is given to me 3535.. I configured my outlook and everything is going fine.
-
Apr 22nd, 2009, 04:20 PM
#29
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
we can spend ever in here to solve this problem, but you have 4 choices to solve ur problem:
1- Switch to .Net (see above to learn more about which class you should use.)
2- Configure your hosting account and use Google apps and then use the above code.
3- Create a new ftp account and a new email account called sender@yourdomain.com and send them to me with their passwords and i will see if i can solved it.
4- Switch to another hosting account, and if you like i will give you a free 1 year hosting on my server, and then u can use Google apps and i will send you all the codes you need to work smoothly on my server.
I prefer the choice number 2, because i like to know what will be the solution for your problem, and to be helpful for other users in the future.
Thanks
-
Apr 22nd, 2009, 11:04 PM
#30
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
thanks bachir8k..Ok i will try your first and second advice then if the same problem occur then i will post here. Have a nice day bachir8k.
-
Apr 22nd, 2009, 11:56 PM
#31
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
now it is working bachir8k..I just misconfigured my ports in ssl port. I check the website of my hosting i got the point there. Thanks a lot bachir8k. Now i will be working to get the feedback from the recipient's server. If they will accept or the mail bounceback and what are the specific errors. Do you have a any ideas on how to get the SMTP Status codes bachir8k?
Last edited by shyguyjeff; Apr 27th, 2009 at 01:55 AM.
-
May 3rd, 2009, 12:12 AM
#32
Hyperactive Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hello everyone, is there anyone can get the bounce back emails using this setup? I was stock on this part. One thing also I want is that everytime I send email to the receiver, how can I remove the words "on behalf of" in the from area of the message? Thanks everyone.
-
Oct 26th, 2010, 08:23 AM
#33
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Hi the above code works well in sending the mail,can you help me with the code to get an email receipt? because i need to know if the email got to the recipient or not
-
Nov 23rd, 2010, 10:34 AM
#34
Junior Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
can someone tell me, please, what parameters or functions or something like that, of the following code should be declared in code. I have declared only iMsg, iConf, Flds and schema, all as string.
When I start the code it gives this error: "Invalid qualifier" and marks iConf in line 3: Flds = iConf.Fields
Originally Posted by bachir8k
Ok guys, this is a new code i am working with now, its more better because even hotmail will put your email in the inbox and not in the junk.
Code:
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "youremail@gmail.com"
Flds.Item(schema & "sendpassword") = "yourpassword"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "info@bachir.com"
.From = "Bachir El Charif <info@bachir.com>"
.Sender = "Bachir.com"
.ReplyTo = "info@bachir.com"
.Subject = "A message from Bachir."
.HTMLBody = "This is a html email, please ignore"
.Organization = "Bachir"
Set .Configuration = iConf
SendEmailGmail = .Send
End With
set iMsg = nothing
set iConf = nothing
set Flds = nothing
-
Nov 25th, 2010, 02:23 AM
#35
New Member
Re: How to send mail using vbsendmail.dll and smtp.gmail.com
Morris_Zg did you declare the variables?
HTML Code:
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|