Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Jul 15, 2019 11:16 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: sending email with credentials
PostPosted: Wed Jul 18, 2012 4:42 am 
Offline

Joined: Fri Nov 20, 2009 9:31 am
Posts: 23
Sendmail is installed on a linux Centos5 server.
Email is send on port 587 with credentials username and password, stored in /etc/mail/authinfo.
Sending mail directly with telnet <smtp.provider> 587 is ok
Sending mail with
mail -s "my subject" {email-address} < {some file} is ok

Now I am trying to send email with realbasic and I don't know how to do that 'the right way'

I tried:
dim smtpss as SMTPSecureSocket
dim m As EmailMessage
smtpss.Address = "smtp.auth.orange-business.com"
smtpss.Username = "aaaaa@zzzzzzzzzzz"
smtpss.Password = "{my password}"
smtpss.Port = 587

m = new EmailMessage
m.FromAddress = "info@mydomain.fr"
m.Subject = "my subject"
m.BodyPlainText = "some text"
m.AddRecipient "my emailaddress"

smtpss.Messages.Append m
smtpss.SendMail

This produces an error:
An exception of class of NilObjectException was not handled.

Is this the right way to do this or is there a better way?

Thanks for help
Roland


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Wed Jul 18, 2012 6:50 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
roland_br wrote:
I tried:
dim smtpss as SMTPSecureSocket
dim m As EmailMessage
smtpss.Address = "smtp.auth.orange-business.com"
...
This produces an error:
An exception of class of NilObjectException was not handled.


If that's literally your code, then the NilObjectException is due to the fact that you're not creating a SMTPSecureSocket. Before you set any properties you need:
smtpss = New SMTPSecureSocket

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Wed Jul 18, 2012 9:48 am 
Offline

Joined: Fri Nov 20, 2009 9:31 am
Posts: 23
Sorry for this forgotten 'new'. Just back from Holiday.

Now it works, thank you very much.

I'm not so experienced with email issues. Therefor I just wonder about the following:
I tested this on my server, which is in Belgium. The clients server is in France. Both have different smtp servers.

How is it possible that a test of the mailprogram on my server is succesfull, without changing anything. I mean, the settings in France and Belgium are the same. Is that normal? Or is Realbasic a wonderboy or -girl?

Can you explain this?
Thanks
Roland


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Wed Jul 18, 2012 1:27 pm 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
roland_br wrote:
How is it possible that a test of the mailprogram on my server is succesfull, without changing anything. I mean, the settings in France and Belgium are the same. Is that normal? Or is Realbasic a wonderboy or -girl?

Can you explain this?


I don't understand what you're asking.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Wed Jul 18, 2012 4:01 pm 
Offline

Joined: Fri Nov 20, 2009 9:31 am
Posts: 23
As far as I know, one can only send email trough the smtp server of the provider that gives you the internet connection.

So how is it possible to send email via the smtp server of another provider. I never could do that. Every internet provider has its own smtp server.

??
I hope you understand what I'm trying to say?

Roland


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Wed Jul 18, 2012 4:47 pm 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
roland_br wrote:
As far as I know, one can only send email trough the smtp server of the provider that gives you the internet connection.


You can send email through any smtp server which allows you to connect and send email. Some large ISPs limit access to their customers to help prevent spam, but that's not a rule of the protocol.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Thu Jul 19, 2012 2:39 am 
Offline

Joined: Fri Nov 20, 2009 9:31 am
Posts: 23
Sorry for your time, I took, and thanks for your reply.

Until now I allways was unsuccessful wenn I was trying to send email through the smtp server of another provider.

One learns everyday. :-)

Friendly regards,
Roland


Top
 Profile  
Reply with quote  
 Post subject: Re: sending email with credentials
PostPosted: Thu Jul 19, 2012 5:44 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
roland_br wrote:
Sorry for your time, I took, and thanks for your reply.


Why be sorry? I'm happy to help :)

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group