Send Email via Neobook

General questions about NeoBook

Moderator: Neosoft Support

Locked
ajhunt
Posts: 266
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom
Contact:

Send Email via Neobook

Post by ajhunt »

Hi Neobookers, I was wanting to send an email with an attachment but with the built in SendMail command fails as now basically all smtp mail server require authentication, something SendMail does not cater for. What's the best way to send an email without using SendMail - as an example using googlemail as the mail server. Many thanks guys. I've tried using the Function 'SendGMail' but my users might not have a gmail account and was looking for something which could be used by any if possible - maybe they will have to setup a gmail account.
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Send Email via Neobook

Post by Neosoft Support »

Here's a VBScript function tha works pretty well for most mail servers. Copy it into your NeoBook Functions folder and use the Call action to execute it.

Code: Select all

{NeoBook Function}
Version=5.80
Language=VBScript
Param=[%From]|Text|From:
Param=[%To]|Text|To:
Param=[%Subject]|Text|Subject
Param=[%Msg]|Text|Message:
Param=[%Server]|Text|SMTP Server:
Param=[%User]|Text|User Name/Account:
Param=[%Password]|Text|Password:
Param=[%Port]|Number|Port:
{End}
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "[%Subject]"
objMessage.From = "[%From]"
objMessage.To = "[%To]"
'objMessage.TextBody = "[%Msg]"
objMessage.HTMLBody = "[%Msg]"

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
'cdoAnonymous = 0 'Do not authenticate
'cdoBasic = 1 'basic (clear-text) authentication
'cdoNTLM = 2 'NTLM

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

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

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

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

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = [%Port]

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==
objMessage.Send
NeoSoft Support
ajhunt
Posts: 266
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom
Contact:

Re: Send Email via Neobook

Post by ajhunt »

Thankyou NeoSoft, I will keep this for the future. I have it currently working with a sweet plug-in from David de Argentina. Thankyou as always for your support with the great NeoBook.
yanzco
Posts: 192
Joined: Sun Jul 20, 2014 4:07 am

Re: Send Email via Neobook

Post by yanzco »

thanks for this! :D

tried it with gmail..

it sent a reply..
The server rejected the sender address. The server response was: 530 5.7.0 Must issue a STARTTLS command first. d12sm17783656pfn.42 -gsmtp

maybe not working with gmail?.. or some settings i havent configured correctly..
ajhunt
Posts: 266
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom
Contact:

Re: Send Email via Neobook

Post by ajhunt »

Hi yanzco, I currently have it working and sending attachments using "NeoSendMail" plugin from David de Argentina if that helps:

If "[IncludeSMTP]" "=" "Yes"
SetVar "[Attachment]" "C:\[FilenameToSend]"
ae_SendMail_Start "XXXXXXXXXX"
ae_SendMail_Set_MailUser "[SMTPEmailAddress]"
ae_SendMail_Set_MailPass "[SMTPPassword]"
ae_SendMail_Set_SMTPServer "[SMTPServer]"
ae_SendMail_Set_ServerType "[SMTPServerType]"
ae_SendMail_Set_ServerPort "[SMTPPort]"
ae_SendMail_Set_To "[EmailAddress]"
ae_SendMail_Set_From "[SMTPEmailAddress]"
ae_SendMail_Set_ReplyTo "[SMTPReplyEmail]"
ae_SendMail_Set_Subject "[SMTPSubject]"
ae_SendMail_Set_BodyStyle "Text"
ae_SendMail_Set_TextBody "[SMTPMessage]"
ae_SendMail_Set_Attachment "[Attachment]"
ae_SendMail_Send
ae_SendMail_Clear_Attachment
EndIf
yanzco
Posts: 192
Joined: Sun Jul 20, 2014 4:07 am

Re: Send Email via Neobook

Post by yanzco »

too bad, i cant use evualauation copy..
Locked