|
-
Mar 3rd, 2009, 06:22 PM
#1
Thread Starter
Addicted Member
[RESOLVED] email without mail server
I would like to know if it is possible to have a user of my program to send an email to my email account (yahoo.ca). I just want a text box for the user to write a message and a send button to send it. most users will be on their home computers without mail servers. I know I could bring up outlook to send the mail, but I would prefer to just have the text box and send button and nothing else "pop up"
Thank you in advance,
Last edited by scottlafoy; Mar 3rd, 2009 at 07:33 PM.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 3rd, 2009, 07:14 PM
#2
Lively Member
Re: email without mail server
If you go php then yeah. You would need ftp access to a php enabled site. This the way I use.
http://www.w3schools.com/PHP/php_mail.asp
"What is a hackers worst nightmare you may ask? Vista! Not that its hard to bypass its just that it gives you stupid annoying errors!"

-
Mar 3rd, 2009, 10:50 PM
#3
Fanatic Member
Re: email without mail server
Check out MartinLiss' MAPI app - might give you Ideas
http://www.vbforums.com/showthread.p...highlight=MAPI
-
Mar 4th, 2009, 02:02 AM
#4
Thread Starter
Addicted Member
Re: email without mail server
Thanks, I will take a look at that and see what I can do.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 4th, 2009, 02:20 AM
#5
Re: email without mail server
most users on home computers have stmp server access through their internet service provider,
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 5th, 2009, 12:02 PM
#6
Thread Starter
Addicted Member
Re: email without mail server
Well I have looked around and tried all sorts of things, I even opened a gmail account to send mail through but they all seem way to complicated for me. I am settling on an outlook solution. Below is my code:
Code:
Private Sub Command6_Click()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "[email protected] "
.Subject = "Hello"
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
.Send 'send the mail
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
I am getting an error when I send the email, on the .send line. it says: unable to perform the operation. File access is denied. you do not have the permission required to access the file D:\bla\bla\bla\outlook.pst
is the error from my code? or is there something wrong with the setup of outlook?
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 5th, 2009, 03:23 PM
#7
Re: email without mail server
are you logged into windows as administrator?
are you running on vista operating system?
sending through a gmail account using cdo.message is simple in XP, but every type of emailing is more difficult in vista
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 5th, 2009, 03:52 PM
#8
Thread Starter
Addicted Member
Re: email without mail server
I am running on xp I have administrative proporties on my account. It is my computer. Some people might use vista to run my program but not many. I have tried a few different ways of using gmail but nothing works so far. I will go look for a tutorial on it.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 5th, 2009, 04:07 PM
#9
Re: email without mail server
I have the same issue in this post:
http://www.vbforums.com/showthread.php?t=559845
I have decided to purchase a ocx
Here: http://www.emailarchitect.net/webapp/smtpcom/
I tried this one and it did work on vista
and here: http://www.perfectionbytes.com/porta...n/pricing.aspx
They both replied to my emails saying they will work on windows 7
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Mar 5th, 2009, 07:52 PM
#10
Re: email without mail server
The first of those appears to have a "cheat mode" that attempts to bypass the public email network by doing an MX lookup on the recipient and directly relaying to the recipient's email server.
Many email servers will not trust these random relays and will reject such connections. My home ISP (one of the largest in the U.S.) also proxies anything on outbound TCP port 25, redirecting it to their email server. If the credentials aren't valid (user/pw) the email send will fail from here.
I hope you get your money's worth, but personally I suspect you are still going to have problems. Those operating email servers work very hard to reduce spam, and this has pretty much crippled the mail network for random messaging. Usually email only gets through if you follow very specific protocols to ensure it was human-originated or as close as possible.
-
Mar 5th, 2009, 09:18 PM
#11
Re: email without mail server
 Originally Posted by dilettante
The first of those appears to have a "cheat mode" that attempts to bypass the public email network by doing an MX lookup on the recipient and directly relaying to the recipient's email server.
Many email servers will not trust these random relays and will reject such connections. My home ISP (one of the largest in the U.S.) also proxies anything on outbound TCP port 25, redirecting it to their email server. If the credentials aren't valid (user/pw) the email send will fail from here.
I hope you get your money's worth, but personally I suspect you are still going to have problems. Those operating email servers work very hard to reduce spam, and this has pretty much crippled the mail network for random messaging. Usually email only gets through if you follow very specific protocols to ensure it was human-originated or as close as possible.
thanks for the info, if you are correct then i'm running out of options. The only other way would be to provide them with an online email server.
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Mar 5th, 2009, 09:37 PM
#12
Re: email without mail server
The options are frustratingly slim.
Some people find that they have to sign up with an intermediate email hosting service that listens on an alternate SMTP port (often 587). I think this is one such host:
E-mail - MSA / Alternate port SMTP service
In the future people may move to things like Amazon Simple Queue Service (Amazon SQS) but it is only practical for "phone home" messaging like crash reports and such. It can't send emails to arbirtrary recipients, and doesn't actually handle email as such at all.
-
Mar 5th, 2009, 09:38 PM
#13
Re: email without mail server
 Originally Posted by scottlafoy
Well I have looked around and tried all sorts of things, I even opened a gmail account to send mail through but they all seem way to complicated for me. I am settling on an outlook solution.
Here is a program I created in VB 6.0 maybe you can get something from it!
http://www.vbforums.com/showthread.php?t=557488
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Mar 5th, 2009, 09:48 PM
#14
Re: email without mail server
Going back to square one, what sort of emailing do you need to do?
If you want to have your program initiate email from your clients to their customers that puts some real constraints on things. For example Amazon SQS and an alternate port SMTP service are both useless then.
Ultimately you'll need to require that your clients have an SMTP account (not just web mail like Yahoo, etc.). You'll also have to ask them to configure their email host, user, pw, etc. for your program just as required to set up their account on Outlook Express.
As I said in the other thread, CDO cannot get the account info from Windows Mail in Vista as it did from Outlook Express on XP and Win2K. At least not that I have been able to determine.
And in Windows 7 you don't get either Outlook Express or Windows Mail. You have to install Windows Live Mail or a 3rd party email client. I suspect that CDO can't see the default email account config info there either, but I haven't tried.
-
Mar 5th, 2009, 09:49 PM
#15
Thread Starter
Addicted Member
Re: email without mail server
Thank you Nightwalker83 I will take a look at that. Some one mentioned a "phone home" thing. That is basically what I am doing. Users of my program to send me and email. The message will go to me and no one else.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 5th, 2009, 09:57 PM
#16
Re: email without mail server
 Originally Posted by dilettante
The options are frustratingly slim.
Some people find that they have to sign up with an intermediate email hosting service that listens on an alternate SMTP port (often 587). I think this is one such host:
E-mail - MSA / Alternate port SMTP service
In the future people may move to things like Amazon Simple Queue Service (Amazon SQS) but it is only practical for "phone home" messaging like crash reports and such. It can't send emails to arbirtrary recipients, and doesn't actually handle email as such at all.
Thanks for the information
I am trying to get my app to run on vista and this is holding me up. for the time being when they click to email a contract, invoice etc a message will inform them it is only supported in xp
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Mar 5th, 2009, 10:20 PM
#17
Re: email without mail server
Have you considered MAPI instead of CDO? This should work for the majority of desktop email clients. I believe it will present other limitations though, like popping up the email for the user to modify/send before it actually goes.
Demo using the VB6 MAPI controls:
Code:
Option Explicit
Private Sub Form_Load()
Show
MAPISession1.SignOn
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.RecipAddress = "[email protected]"
.MsgSubject = "Hello, testing"
.MsgNoteText = "Testing, testing." & vbNewLine _
& "This is a test."
.Send False
End With
MsgBox "Done"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MAPISession1.SignOff
End Sub
Seems to work on Vista just fine. Windows Mail pops up a warning for the user to Ok.
Last edited by dilettante; Mar 5th, 2009 at 10:39 PM.
Reason: update
-
Mar 5th, 2009, 10:45 PM
#18
Re: email without mail server
 Originally Posted by dilettante
Have you considered MAPI instead of CDO? This should work for the majority of desktop email clients. I believe it will present other limitations though, like popping up the email for the user to modify/send before it actually goes.
Demo using the VB6 MAPI controls:
Code:
Option Explicit
Private Sub Form_Load()
Show
MAPISession1.SignOn
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.RecipAddress = "[email protected]"
.MsgSubject = "Hello, testing"
.MsgNoteText = "Testing, testing." & vbNewLine _
& "This is a test."
.Send False
End With
MsgBox "Done"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MAPISession1.SignOff
End Sub
Seems to work on Vista just fine. Windows Mail pops up a warning for the user to Ok.
Thanks i will try it. Can it send attachments?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Mar 5th, 2009, 10:46 PM
#19
Re: email without mail server
I have not tried to send attachments, but from the manual it seems capable of it.
-
Mar 5th, 2009, 11:25 PM
#20
Re: email without mail server
 Originally Posted by dilettante
I have not tried to send attachments, but from the manual it seems capable of it.
My code I linked to in post #13 uses the mapi control!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Mar 6th, 2009, 04:25 AM
#21
Re: email without mail server
MAPI requires an mapi enabled email client to be installed, such as Outlook
attachments can be added in the attachments collection,
one consideration is to use a gmail account, as cdo has to be fully configured to send to it, it will not rely on default configurations, but the configuration would be the same for all accounts, apart from username and password, an account could be set up at gmail for each user, who subscribes to your program
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 6th, 2009, 11:48 AM
#22
Thread Starter
Addicted Member
Re: email without mail server
 Originally Posted by westconn1
one consideration is to use a gmail account, as cdo has to be fully configured to send to it, it will not rely on default configurations, but the configuration would be the same for all accounts, apart from username and password, an account could be set up at gmail for each user, who subscribes to your program
What about setting up one gmail account and every copy of the program uses that hard coded to send me and email, the only variable being a text box where they type me a message. I have been trying to do something like that but I cannot make anything work.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 6th, 2009, 03:24 PM
#23
Re: email without mail server
What about setting up one gmail account and every copy of the program uses that hard coded to send me and email, the only variable being a text box where they type me a message. I have been trying to do something like that but I cannot make anything work.
that is an easy solution
only downside i know, which probably won't affect you is gmail will not allow to spoof the return address, so the return address would always be the gmail account, here is the sample code
Code:
Set objmessage = CreateObject("CDO.Message")
objmessage.Subject = "Example CDO Message"
objmessage.From = "[email protected]"
objmessage.To = "me" ' sent to myself, not at gmail, use a valid email address
objmessage.TextBody = "This is some sample message text."
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
'Your password on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.gmx.com"
'Server port (typically 25)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
'Use SSL for the connection (False or True)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objmessage.Configuration.Fields.Update
objmessage.Send
Set objmessage = Nothing
' gmail configuration
Set objConfig = CreateObject("cdo.configuration")
Set Flds = objConfig.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") = "mailaddress"
Flds.Item(schema & "sendpassword") = "password"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
Set objMessage.Configuration = objConfig
this has configuration for gmail at the bottom and gmx, both are free mail servers, gmx will allow more types of attachments, gmail does not allow exe and some other types as attachments
neither of these use the default port of 25, so is less likely to be prevented by isp blocking port 25, gmail uses ssl (secure sockets layer)
Last edited by westconn1; Jan 13th, 2010 at 04:53 AM.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 6th, 2009, 03:35 PM
#24
Re: email without mail server
One other alternative which you may not want is what i have done, where the emails only get sent to me.
I hired a renta coder that created an ocx that sends emails from my app thru
my online jMail component on my website. I use this for users to send recommendations, and silently sending any error reports. The nice thing is they do give any email info at all. One other nice thing about this is I also receive all their computer details, app.path, OS etc
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Mar 6th, 2009, 05:26 PM
#25
Thread Starter
Addicted Member
Re: email without mail server
Thank you for all the replies, I sure like the sound of that OCX but I think rent a coder is out of my price range.
westconn1 I am trying the code you posted and I am obviously miss-using it. I get a "transport failed to connect to server" error on the objmessage.send line.
Code:
Private Sub Command1_Click()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "[email protected]"
objMessage.To = "[email protected]" ' sent to myself, not at gmail
objMessage.TextBody = "This is some sample message text."
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "scottstimetracker"
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "******"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.gmx.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
' gmail configuration
Set objConfig = CreateObject("cdo.configuration")
Set Flds = objConfig.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") = "[email protected]"
Flds.Item(schema & "sendpassword") = "*******"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
Set objMessage.Configuration = objConfig
End Sub
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 6th, 2009, 09:36 PM
#26
Re: email without mail server
looks like you are using the gmail part after you have send. you need to set all the configuration for the server you are using, before sending
the code contained configurations for 2 free email hosts, you only need to set up for one
i have successfully used both email services
if you want me to test code for you pm me your password
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 7th, 2009, 03:14 PM
#27
Thread Starter
Addicted Member
Re: email without mail server
Thank you all, the solution above from westconn1 works. I can finally put this tread to rest.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
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
|