[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

send email with out smtp server?

Posted on 2006-10-19
20
Medium Priority
?
332 Views
Last Modified: 2011-10-03
hi,

1. if we have just an internet connection and no smtp server is it possible to send e-mail? if yes how?

2. if not, then can we send e-mail if we have an account in say 'hotmail' or 'yahoo mail' or 'gmail'?
0
Comment
Question by:expertfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 10
20 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 17778096
0
 
LVL 28

Expert Comment

by:Ark
ID: 17778138
0
 

Author Comment

by:expertfan
ID: 17783806
friends, i need vb6 code to achieve this. thanks.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:Ark
ID: 17785365
Directly from above link:
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
     
'This section provides the configuration information for the remote SMTP server.
     
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
     
' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com" 'Change to your user name account at remote SMTP server, i.e. expertfan@hotmail.com
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword" 'Change to your password at remote SMTP server
     
ObjSendMail.Configuration.Fields.Update
     
'End remote SMTP server configuration section==
     
ObjSendMail.To = "someone@someone.net" 'recepient address
ObjSendMail.Subject = "this is the subject"   'Subject
ObjSendMail.From = "someone@someone.net" 'your address
     
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body" 'you can use HTML tags here, i.e. "<b>Hello world</b>"
ObjSendMail.TextBody = "this is the body"
     
ObjSendMail.Send
     
Set ObjSendMail = Nothing
0
 
LVL 28

Expert Comment

by:Ark
ID: 17785369
PS
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com" 'change to your remote SMTP server address, i.e. "mail.hotmail.com"
0
 

Author Comment

by:expertfan
ID: 17786457
Ark,

what are these

http://schemas.microsoft.com/cdo/configuration/sendusing

these URLs are not opening i even tried http://schemas.microsoft.com/cdo/configuration
and http://schemas.microsoft.com/cdo

none of these URLs open, so whats their purpose?
0
 
LVL 28

Expert Comment

by:Ark
ID: 17786482
Those URLs aren't public domains - they are special addresses where CDO mail object check properties settings. Just copy/paste this sample "AS-IS", change:

1. "mail.yoursite.com" - to gmail/hotmail or whatever mail SMTP server address
2. "someone@someone.net" - to recepient address
3. "someone@someone.net" - to your address

If remote SMTP server (gmail, yahoo, hotmail) require authorization with login/password - uncomment following piece of code:

'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com" 'Change to your user name account at remote SMTP server, i.e. expertfan@hotmail.com
'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword" 'Change to your password at remote SMTP server
 
0
 

Author Comment

by:expertfan
ID: 17786531
hey,

i got the following error.

run-time error '-2147220973' (80040213)
The transport failed to connect to the server
0
 
LVL 28

Expert Comment

by:Ark
ID: 17786876
Did you set all properties according SMTP server requirements?
For example, smtp.gmail.com use port 465 or 587 and require SSL. Here is gmail; sample:

Private Sub Command1_Click()
   Dim ObjSendMail
   Set ObjSendMail = CreateObject("CDO.Message")
     
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True  'Use SSL for the connection (True or False)
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
     
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  'basic (clear-text) authentication
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "expertfan@gmail.com"
   ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "your_password_at_gmail"
     
   ObjSendMail.Configuration.Fields.Update
     
   ObjSendMail.To = "someone@someone.net" 'recepient address
   ObjSendMail.Subject = "this is the subject"   'Subject
   ObjSendMail.from = "someone@someone.net" 'your address
     
   ObjSendMail.TextBody = "this is the body"
     
   ObjSendMail.Send
     
   Set ObjSendMail = Nothing

End Sub

0
 

Author Comment

by:expertfan
ID: 17787138
even with this code, i am getting the same error. i too used gmail id itself.
0
 

Author Comment

by:expertfan
ID: 17787141
i am connected to internet via proxy server does this make a differnce?
0
 
LVL 28

Expert Comment

by:Ark
ID: 17787169
Some proxies doesn't allow identifictaions from local IPs - they replace it with their own. Can you connect with remote SMTP with any e-mail clients (Outlook Express, The Bat!, Eudora etc.)?
0
 

Author Comment

by:expertfan
ID: 17787178
i have only 'microsoft outlook' client, how can check out this ?
0
 
LVL 28

Expert Comment

by:Ark
ID: 17787199
Which connection does your MSOutlook use? Exchange/Pop3 etc?
Actually, you can use MSOutlook object to send e-mail using MSOutlook settings
0
 

Author Comment

by:expertfan
ID: 17787206
i use 'exchange server'.

but my application should work on machine which will be on internet (might or might not be behind firewall) but it should send out the mail with the client on that PC.
0
 

Author Comment

by:expertfan
ID: 17789113
hi ark,

your code is working fine when there is no firewall.


but doesn't work when behind firewall....please advise.
0
 
LVL 28

Expert Comment

by:Ark
ID: 17792077
Just add your application to the firewall exception list.

You can also try direct winsock e-mailer (http://www.vbforums.com/showthread.php?t=334745), but I'm sure firewal block it too
0
 
LVL 28

Accepted Solution

by:
Ark earned 1500 total points
ID: 17792089
PS - try also another smtp servers which use default smtp 25 port - all firewalls usualy don't block this port by default, but anyway all depends on local firewall settings
0
 

Author Comment

by:expertfan
ID: 17793502
>>>try also another smtp servers which use default smtp 25 port

hi ark, do u know any example of hotmail or yahoo which works on 25 port?
0
 

Author Comment

by:expertfan
ID: 17878669
thanks Ark, i hope some one can get this working for 'behind the firewall' too...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question