Source language: Translate to:

Send Email and a file

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

Re: Send Email and a file

Postby David de Argentina » Tue Oct 30, 2012 10:52 am

Ok, i will reveal a secret to send mails from client machines without SMTP servers:

1.- Create a Yahoo (or Hotmail, or Gmail, etc) account. This account is a "transfer" mail to your "real" e-mail.
Note: i prefer yahoo mail because allows send data using port 25. If you use another server like Gmail or Hotmail, you must use NeoSendMail plugin in order to set the correct server settings

2.- after create the account, you will have this settings: (this sample is using Yahoo.com.ar)

[MailServer] : smtp.mail.yahoo.com.ar
[Account] = yourtranferaccount@yahoo.com.ar
[MailUserID]: yourtransferaccountname
[MailUserPassword]: yourcounteraccountpass

3.- Finally, you can send mail from your client machines doing something like this:

SendMail "ToYourRealEmailAccount@yourserver.com" "yourtranferaccount@yahoo.com.ar" "subject" "message (including client data)" "attachments"

Using this technique, your client uses your intermediate transfer account to send mails and allways works.

My more and more devaluated cent,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re:

Postby dpayer » Tue Oct 30, 2012 2:17 pm

Trainman wrote:Gaev

Thank you for the information, but that leaves me thinking that you are unable to setup a system that will attached a file and sent, without the possibility of needing to configuring your system.

Thanks

Trainman


If you are trying to get users of your app to send you a file, why not PROVIDE a server for them to send you information? Get a hosted account that provides POP and SMTP services. Create an account that you can authenticate on to send mail. Create another account to send the information to and then embed the info in your app, it will be invisible to your users so it is unlikely to be compromised.

Yes, such things are not free but if you are making money at this, then it should be worthwhile. Or if you are doing this for a customer, have them provide an SMTP authenticating account on a server and then use that information.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Send Email and a file

Postby smokinbanger » Tue Oct 30, 2012 6:09 pm

Part 1:Just don't forget what Wrangler mentioned, that a hacker could potentially reverse engineer your pub and, if the login credentials are anywhere inside the pub, could gain access to your email account. However, they would need a motive; just about anyone can get a free email account that uses SMTP/IMAP. Google, Yahoo and others have them available. So really the only value your account could have is the contacts/addresses that you send/receive emails to/from. That being said, I have pubs that do send me files from the user's PC using my account and yes they do have the login credentials hard coded. BUT, I send it to myself so the only address that the account ever communicate with is itself therefor rendering my account almost worthless to any hacker that can get there own free account.

Part 2:I found out really quickly that the built in email functions in Neobook are almost worthless for my needs. Many, if not most, email providers require TLS/SSL authentication. What I have found that works very well for me is this handy little function. I can't take full credit for it, I believe someone else on this forum provided it and I just modified it to fit my needs:
Syntax: [ Download ] [ Hide ]
Using Visual Basic Syntax Highlighting
{NeoBook Function}
Version=5.70
Language=VBScript
Param=[%1]|Text|From:
Param=[%2]|Text|To:
Param=[%3]|Text|SMTP Server:
Param=[%4]|Text|User Name:
Param=[%5]|Text|Password:
Param=[%6]|Text|Message: (IF HTML MESSAGE USE ' in place of ")
Param=[%7]|Text|Subject
Param=[%8]|FileName|Attatchment- comma seperated list
Param=[%9]|Variable|Variable to store status- True if successful or false if not
{End}
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "[%7]"
objMessage.From = "[%1]"
objMessage.To = "[%2]"
'objMessage.TextBody = "[%6]"
objMessage.HTMLBody = "[%6]"

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "[%3]"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[%4]"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "[%5]"


'Use SSL for the connection (False or True)

'if "[UseSSL]" = "False" Then
'   objMessage.Configuration.Fields.Item _
'   ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
 
   'Server port (typically 25)
'   objMessage.Configuration.Fields.Item _
'   ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'else
  objMessage.Configuration.Fields.Item _
   ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
   
   'Server port 465
  objMessage.Configuration.Fields.Item _
   ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
'end if

'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") = 60

If "[%8]" <> "" Then
   a=Split("[%8]",",")
   for each x in a
       objMessage.AddAttachment ( x )
   next
End If

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

On Error Resume Next


objMessage.Send

If Err.Number = 0 Then
    publication.nbSetVar "[%9]", "True"
Else
    publication.nbSetVar "[%9]", "False"
End If


Set objMessage = Nothing
Parsed in 0.011 seconds, using GeSHi 1.0.8.10
Just Sayin'...
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Re: Send Email and a file

Postby David de Argentina » Wed Nov 14, 2012 3:57 pm

smokinbanger wrote:Part 2:I found out really quickly that the built in email functions in Neobook are almost worthless for my needs. Many, if not most, email providers require TLS/SSL authentication. What I have found that works very well for me is this handy little function. I can't take full credit for it, I believe someone else on this forum provided it and I just modified it to fit my needs:
{NeoBook Function}
Version=5.70
Language=VBScript
Param=[%1]|Text|From:
Param=[%2]|Text|To:
Param=[%3]|Text|SMTP Server:
Param=[%4]|Text|User Name:
Param=[%5]|Text|Password:
Param=[%6]|Text|Message: (IF HTML MESSAGE USE ' in place of ")
Param=[%7]|Text|Subject
Param=[%8]|FileName|Attatchment- comma seperated list
Param=[%9]|Variable|Variable to store status- True if successful or false if not
{End}
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "[%7]"
objMessage.From = "[%1]"
objMessage.To = "[%2]"
'objMessage.TextBody = "[%6]"
objMessage.HTMLBody = "[%6]"

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "[%3]"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[%4]"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "[%5]"


'Use SSL for the connection (False or True)

'if "[UseSSL]" = "False" Then
' objMessage.Configuration.Fields.Item _
' ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Server port (typically 25)
' objMessage.Configuration.Fields.Item _
' ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'else
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

'Server port 465
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
'end if

'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") = 60

If "[%8]" <> "" Then
a=Split("[%8]",",")
for each x in a
objMessage.AddAttachment ( x )
next
End If

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

On Error Resume Next


objMessage.Send

If Err.Number = 0 Then
publication.nbSetVar "[%9]", "True"
Else
publication.nbSetVar "[%9]", "False"
End If


Set objMessage = Nothing[/syntax]


As you can see on:

viewtopic.php?f=22&t=16581

The author of the post is David de Argentina

Nice guy, isn't it ? :lol:

My very very devaluated cent,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: Send Email and a file

Postby smokinbanger » Fri Nov 23, 2012 12:38 pm

David de Argentina wrote:Nice guy, isn't it ? :lol:

I must admit!
Just Sayin'...
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Previous

Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 0 guests