So I went to http://documentation.xojo.com/UserGuide:Email and followed the instructions and essentially copied the code. Made the appropriate changes to the code and… I get the errors listed below:
frmEventTracking.bvlBtnEmail.MouseDown, line 12
This item does not exist MailSocket.Address = “smtp.gmail.com”
frmEventTracking.bvlBtnEmail.MouseDown, line 12
Type “Int32” has no member named “Address” MailSocket.Address = “smtp.gmail.com”
frmEventTracking.bvlBtnEmail.MouseDown, line 13
This item does not exist MailSocket.Port = 465
Mmm, no… I am not sure how to do that… yet. TO be honest I have never had to deal with classes for most of my applications (well… ones that I haven’t created that is…)
Ouch. Don’t ever do that. The socket can go out of scope before the code finishes. You will never get errors. For threads where you make the socket in code you have to use AddHandlers to get the events.
I have my own thread class which includes all the necessary state. So no chance of a socket going out of scope and indeed I use AddHandler - that’s what it’s for.
If you like to send emails, please check MBS Xojo CURL Plugin and the CURLEmailMBS class.
Our example projects show you how to build and send emails with attachments, multiple recipients, html & plain text.
The broader context is “How do I send emails from Xojo?” Seasoned developers know that there are many situations in which the built-in classes are insufficient. Therefore, alternative solutions are necessary. While Christian’s comments do not directly address the OP question, they are still germane to the broader issue.
That’s your assumed broader context. Why assume when the known context is right in front of us and address what we do know, not what we don’t. For example, the broader context could well have been ‘I am learning Xojo and have picked a random documentation code snippet and cannot get it to work’ with a follow-up (i.e. still not assuming here) ‘I have not done much with classes’. This was met with an advert.
Don’t think anyone is disagreeing with you.
As before, your assumed broader issue.
The irony is that the question was answered but my follow-up (which rounded out the answer to the direct question being asked) was farmed out to the ‘irrelevant’ thread. So now (unlike earlier) this thread does not have an answer to the question (it did earlier) but does have an advert.
Yes Kem. As per my post above, the solution to the question asked was farmed out to the irrelevant thread. If you would be so kind as to replace it here - the OP’s question will then be answered which is all I (and, according to the question) the OP wanted in the first place.
@John_McDonald, did you try the suggestion from @Paul_Lefebvreto play with the examples coming with Xojo? They show how to use it.
What is the status of the project?
Did you try SMTPSecureSocket class to benefit from TLS encryption, which is certainly required for gmail?
Did you put MailSocket as item on a window or add it as property to the window and instantiate it in code? Just having it as local variable won’t be enough.
I am at a complete loss here. Back to topic ? You mean the one that your spam derailed, right ? You have to be joking. Also why ask if John tried the examples ? He asked about making something specific work. He did not ask for samples and I find the timing of @Paul_Lefebvre’s post (intermixed, seemingly injected on the face of it) quizzing to say the least.
The problem @John_McDonald was facing was already solved but the thread was split and the last part of the answer was siphoned off to the thread starting with the ‘Irrelevant…’ title.
If this is what this forum is about then please ban me @Xojo. I am clearly wasted and indeed wasting my time here.
I have, in the last couple of days, lost an enormous amount of respect for what I (and I guarantee you a great deal of others) believed this place was about.
When I came here years ago, I immediately noticed what I believed to be a great deal of spam but bit my tongue. Well I am at the point that I do not need to do that anymore so I have commented. Any objective person sees that this was spam and shame on @Xojo for not having the fortitude to call it out as I did.
Enough said I believe. Happy to have stood up for what is correct, and deep down objective, rational and logical members know that what I have said is, indeed, correct but let’s not let what is right stand in the way of relationships and economics, as it appears from the outside, to be.