Liberty BASIC Community Forum
« Send email, with optional attachments. »

Welcome Guest. Please Login or Register.
Sep 19th, 2017, 9:06pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 veryhotthread  Author  Topic: Send email, with optional attachments.  (Read 1952 times)
stefanhes
Guru
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 723
xx Re: Send email, with optional attachments.
« Reply #9 on: Nov 2nd, 2009, 4:43pm »

Thank you Stefan!!

I made a logfile.

I saw the problem!!

It was the old MS_DOS not liking spaces in the path name...


Problem solved

thank you again to point me to the right direction.
User IP Logged

http://www.soundofanimals.com
http://sincosin.com
Stefan Pendl
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Computers are like babies, you must teach them what you like them to do ...


Homepage PM

Gender: Male
Posts: 5295
xx Re: Send email, with optional attachments.
« Reply #10 on: Nov 3rd, 2009, 12:46am »

on Nov 2nd, 2009, 4:43pm, stefanhes wrote:
Thank you Stefan!!

I made a logfile.

I saw the problem!!

It was the old MS_DOS not liking spaces in the path name...


Yes, CHR$(34) is getting mandatory these days, you can not access most files without two of them wink
« Last Edit: Nov 3rd, 2009, 12:46am by Stefan Pendl » User IP Logged

Stefan

Make sure to read and follow the Forum Guidelines

Liberty BASIC Pro 4.04, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
BlueDwarf
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 7
xx Re: Send email, with optional attachments.
« Reply #11 on: Jul 16th, 2010, 2:07pm »

Wow this SendEmail program really rocks! Tested it out on my Virgin Mail account and it works like a dream; attachments no problem! smiley
User IP Logged

andy1977
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: Send email, with optional attachments.
« Reply #12 on: Feb 21st, 2013, 5:06pm »

Really hoping somebody can help. I have tried this code, with the 2 files, but all I can get is "runtime error: out of memory:" The .Bas file is saved in the same folder as the files.

On a sidenote, trying to find out what why it wasn't working, I managed to associate .PL files to notepad, but downloaded Perl to associate with instead.

Many thanks in advance, Andrew
User IP Logged

Brandon Parker
Board Moderator

member is offline

Avatar




PM

Gender: Male
Posts: 1115
xx Re: Send email, with optional attachments.
« Reply #13 on: Feb 21st, 2013, 9:32pm »

Andrew,

Welcome to the forum!!

Without posting the code that you are using we can only guess as to what may be happening. Please post the code you use and someone will definitely help you out.

{:0)

Brandon
« Last Edit: Feb 21st, 2013, 9:33pm by Brandon Parker » User IP Logged

Windows 7 Home Premium 64-bit Intel(R) Quad Core(TM) i5 CPU M 430 @ 2.27GHz 4GB DDR3 RAM
andy1977
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: Send email, with optional attachments.
« Reply #14 on: Feb 22nd, 2013, 02:03am »

Hi, thank you. It is the same code as above, with me own e-mail details:

Code:
'Example to send email using gmail.
'For other services, see their documentation

'requires sendemail.exe and sendemail.pl

from$ = "andrewraab@btinternet.com"
mailuser$ ="andrewraab@btinternet.com"
recipient$ ="jemmaraab@btinternet.com"
server$ = "mail.btinternet.com:25"           '465 of 587
mailpwd$ = "*********"
subject$ = "howdy"
message$ = "test 123"


cmd$ = " -f ";from$;" -t ";recipient$;" -s ";server$;" -xu ";mailuser$;" -xp ";mailpwd$;" -u ";message$;" -a "

run "C:\Users\Andrew\Desktop\sendEmail\sendEmail.exe ";cmd$, Hide

end
 
« Last Edit: Feb 24th, 2013, 09:41am by Stefan Pendl » User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Send email, with optional attachments.
« Reply #15 on: Feb 22nd, 2013, 03:34am »

Try dropping the -a since you don't specify an attachment.

Code:
cmd$ = " -f ";from$;" -t ";recipient$;" -s ";server$;" -xu ";mailuser$;" -xp ";mailpwd$;" -u ";message$ 


The rest of it looks to be correct.
User IP Logged

andy1977
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: Send email, with optional attachments.
« Reply #16 on: Feb 22nd, 2013, 3:13pm »

Thanks for the reply. That definitely makes sense, so I have corrected the error.

Code:
'Example to send email using gmail.
'For other services, see their documentation

'requires sendemail.exe and sendemail.pl

from$ = "andrewraab@btinternet.com"
mailuser$ ="andrewraab@btinternet.com"
recipient$ ="jemmaraab@btinternet.com"
server$ = "mail.btinternet.com:25"           '465 of 587
mailpwd$ = "**********"
subject$ = "howdy"
message$ = "test 123"


cmd$ = " -f ";from$;" -t ";recipient$;" -s ";server$;" -xu ";mailuser$;" -xp ";mailpwd$;" -u ";message$

run "C:\sendEmail\sendEmail.exe ";cmd$ , Hide

end 


Unfortunately I am still getting the error, "Runtime error: Out of memory". Below is the error log, If you don't mind, and have the time to have a look. Thanks (I didn't put in the smiley faces lol)
Code:
Error log timestamp Friday 22/02/13 20:50:20

Runtime error: out of memory

Error(Exception)>>defaultAction
Error(Exception)>>activateHandler: <anUndefinedObject> 
Error(Exception)>>handle
Error(Exception)>>signal
Error class(Exception class)>>signal: <'out of memory'> 
BasicProgram(Object)>>error: <'out of memory'> 
BasicProgram>>terminateRun: <anError> 
[] in BasicProgram>>errorHandlerBlock
ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <anError> 
[] in ExceptionHandler>>handle:
ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
BlockClosure>>invisibleEnsure: <aBlockClosure> 
ExceptionHandler>>handle: <anError> 
ExceptionHandler>>findHandler: <anError> 
Error(Exception)>>activateHandler: <anExceptionHandler> 
Error(Exception)>>handle
Error(Exception)>>signal
Error class(Exception class)>>signal: <'out of memory'> 
BasicProgram(Object)>>error: <'out of memory'> 
[] in RunCommand>>using:
[] in BasicProgram>>begin
ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure> 
[] in ExceptionHandler>>activateDuring:
ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
BlockClosure>>invisibleEnsure: <aBlockClosure> 
ExceptionHandler>>activateDuring: <aBlockClosure> 
ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure> 
BlockClosure>>on: <anError class> do: <aBlockClosure> 
BasicProgram>>begin
BasicProgram>>run
[] in BasicSourcePane>>run
BasicCompiler class>>compileFromString: <'
''Example to send e...'> notify: <aBasicSourcePane> ifSuccess: <aBlockClosure> 
BasicSourcePane>>run
BasicSourceWindow>>run
BasicEditorModel>>run: <aToolbarButton> 
BasicEditorModel(Object)>>perform: <#run:> with: <aToolbarButton> 
ToolbarButton>>triggerClickedEvent
Message>>perform
NotificationManager>>runPendingEvents
NotificationManager>>runEventLoop
Message>>perform
Message>>evaluate
Process>>safelyEvaluate: <aMessage> 
Process>>evaluate: <aMessage> 
 

« Last Edit: Feb 24th, 2013, 09:43am by Stefan Pendl » User IP Logged

Mattestion
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 154
xx Re: Send email, with optional attachments.
« Reply #17 on: Feb 22nd, 2013, 3:39pm »

Nothing in the code you supplied should be giving an out of memory error. It could be something other than LB causing the problem. Have you tried restarting your computer? This will clear the memory and perhaps resolve the problem.
User IP Logged

Just BASIC v1.01 / Liberty BASIC Pro v4.04 / Run BASIC v1.01 / Windows 10 - AMD A10-6700T APU - Radeon HD 8650D - 2.50GHz - 8GB RAM
andy1977
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: Send email, with optional attachments.
« Reply #18 on: Feb 22nd, 2013, 5:08pm »

Getting closer, I think I may have downloaded the wrong sendemail files. I got them from this site: http://caspian.dotconf.net/menu/Software/SendEmail/

and was downloading the 'official' files. Just noticed the files for windows, with TLS Support, downloaded, and now, no more errors. Still struggling to get anything sent through though. Earlier in this thread, someone was successful in sending from a Gmail account, so have now changed my 'from e-mail address', to a gmail.
and got the smtp details from here:
http://www.emailaddressmanager.com/tips/mail-settings.html

Code:
 from$ = "andrewstuartraab@gmail.com"
mailuser$ ="andrewstuartraab@gmail.com"
recipient$ ="andrewraab@btinternet.com"
server$ = "smtp.gmail.com:587"           '465 of 587
mailpwd$ = "*******"
subject$ = "howdy"
message$ = "test 123"


cmd$ = " -f ";from$;" -t ";recipient$;" -s ";server$;" -xu ";mailuser$;" -xp ";mailpwd$;" -u ";message$

run "C:\sendEmail\sendEmail.exe ";cmd$ , Hide

end
 


I would like to say a big thank you, to everyone that is taking the time and effort to reply. I do really appreciate it.
User IP Logged

Mattestion
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 154
xx Re: Send email, with optional attachments.
« Reply #19 on: Feb 22nd, 2013, 5:23pm »

I just remembered that this was recently discussed on the JB forums. See this thread: SENDEMAIL USAGE PROBLEMS

BTW, Reply #7 in that thread has the correct Gmail settings.
User IP Logged

Just BASIC v1.01 / Liberty BASIC Pro v4.04 / Run BASIC v1.01 / Windows 10 - AMD A10-6700T APU - Radeon HD 8650D - 2.50GHz - 8GB RAM
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Send email, with optional attachments.
« Reply #20 on: Feb 23rd, 2013, 03:48am »

Writing the .log file would seem to be the fastest way to get to the root of the problem. John shows how in the rosetta code example.

http://rosettacode.org/wiki/Send_email#Liberty_BASIC
User IP Logged

andy1977
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: Send email, with optional attachments.
« Reply #21 on: Feb 23rd, 2013, 8:12pm »

Just wanted to let you know, that thanks to your help, tips, and clues in the right direction, I have got it to work. Although not from my btinternet account as planned, but from a gmail account I created in place. It's working, so not going to play around with it lol.

There is just one more query though, and having looked through the forums, I don't think it has been asked. In the main body of the message, I can get my text, but was wondering if part way through, if there was a way to start on a new line for text, like a start of a new paragraph?

Normally for printing on paper, or on screen, I know the lprint command on each new line, but realise this doesn't apply in this case.

If it hasn't already become apparent, I bit of a novice to programming.
User IP Logged

Mattestion
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 154
xx Re: Send email, with optional attachments.
« Reply #22 on: Feb 23rd, 2013, 8:57pm »

I believe you would need to use the CRLF character (Carriage Return + Line Feed). It's actually a combination of two characters represented as 13 and 10 on the ASCII chart. So for your message you would have something like this: paragraph1$ + chr$(13) + chr$(10) + paragraph2$. Actually I believe to have a blank line between paragraphs you would need two CRLF.
User IP Logged

Just BASIC v1.01 / Liberty BASIC Pro v4.04 / Run BASIC v1.01 / Windows 10 - AMD A10-6700T APU - Radeon HD 8650D - 2.50GHz - 8GB RAM
Stefan Pendl
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Computers are like babies, you must teach them what you like them to do ...


Homepage PM

Gender: Male
Posts: 5295
xx Re: Send email, with optional attachments.
« Reply #23 on: Feb 24th, 2013, 09:48am »

SendEmail offers the ability to use the contents of a file as the body with a different command line switch.

So remove the body from the command line and use a body file instead.

The command line is only good for simple messages, like one-liners, more complex ones should be saved to a file anyways.
User IP Logged

Stefan

Make sure to read and follow the Forum Guidelines

Liberty BASIC Pro 4.04, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls