Email Sender Problem!!

Hello, Ive tried to code this email sender and i get a bunch of errors!!
so if anybody knows how to fix these of can rebuild the coding for be then please do so!

Coding :

Errors:

Thanks for any help!

You need to create an instance of SMTPSocket and use this instead.

SMTPSocket is the name of the class. You need to create an instance, and use that instance name.

And i think you may need a SMTPSecureSocket to connect to Gmail.

Sorry i came strait from C# can you give me an example???

The included sample project (Example Projects/Communication/Internet/EmailSSLExample) shows how to retreive/send email via Gmail.

yes i looked at it but don’t understand it.

can you please do an example???

and + i copied the coding from the example…

Your code is not from the example project I mentioned. I’d open that example project file and take a look.

You’ll notice in that example the SendDemoWindow has a MailSocket at the bottom. That’s what the code inside of the SendButton.Action event refers to and uses. So you could start by copying that MailSocket and the code inside the SendButton.Action event of that example to your own window to get moving.

yes but then it says the same errors with the Mail Socket

Now i changed it to this, But i still have the same errors…

do i have to have a Dim MailSocket As SMTPSocket???

Yes- you can Dim MailSocket As SMTPSecureSocket. Or add MailSocket as SMTPSecureSocket as a property of your Window or Application. If you’re just starting it out it’s probably easier to copy the MailSocket object to the Window your code is in, like the example does- then you don’t have to worry about it going out of scope.

How put the object in my project??? I’m a starter at this :stuck_out_tongue:

Do you see the MailSocket at the bottom of the SendDemoWindow in the example project? You can just copy that MailSocket to your own window and use it from there.

Oh thanks :D, i will let you know if it works!

No doesn’t work there is now even more problems…

Do you not have to declare variables in C# before using them?

You should probably read both Introduction to Programming with Xojo and the manual

i did Tim, read the INTRODUCTION, maybe you have to declare variables, but i don’t…