Magic User Group

Magic Wiki-Wakka : SendEmail

HomePage :: CATEGORIES | Index :: Changes :: Comments :: Search :: Login/Register
Most recent edit on 2009-02-21 23:25:11 by InformaPlus [PN2]

Additions:
d) By default the Magic mail functions uses port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<PortNumber>' if a different port is to be used in your environment.

Deletions:
d) By default the Magic mail functions uses port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<PortNumber>' if a different port is to be used in your environment.



Edited on 2009-02-21 23:24:31 by InformaPlus [PortNumber]

Additions:
d) By default the Magic mail functions uses port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<PortNumber>' if a different port is to be used in your environment.

Deletions:
d) By default the Magic mail functions uses port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.



Edited on 2009-02-21 23:23:41 by InformaPlus [s3]

Additions:
d) By default the Magic mail functions uses port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.

Deletions:
d) By default the Magic mail functions use port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.



Edited on 2009-02-21 23:22:50 by InformaPlus [s2]

Additions:
c) We suggest you test sending with an unauthenticated (no user, no password) session and a local recipient. External recipients typically require the SMTP service to relay that in turn requires an authenticated (user, password) session.

Deletions:
c) We suggest you test sending with an unauthenticated (no user, no password) session and a local recipient. External recipients typically require the SMTP service to relay that in turn require an authenticated (user, password) session.



Edited on 2009-02-21 23:18:54 by InformaPlus [s]

Additions:
3) In Record Suffix Handler add the following operation:

Deletions:
3) In Record Suffix Handler add the following operations:



Edited on 2009-02-20 22:34:54 by InformaPlus [U Possible reasons]

Additions:
Possible reasons for the above test to fail:

Deletions:
Possible reasons for the above test to fail:



Edited on 2009-02-20 22:34:14 by InformaPlus [U Conclusion]

Additions:
Conclusion:

Deletions:
Conclusion:



Edited on 2009-02-20 22:28:49 by InformaPlus [fix e)]

Additions:
e) Magic mail functions support basic authentication. However, they do not support Transport Layer Security (TLS) authentication. This is a major cause for not being able to use Magic functions with TLS enabled email services (such as Gmail).

Deletions:
e) Magic mail functions support basic authentication. However, they do not support
Transport Layer Security (TLS) authentication. This is a major cause for not being able to use Magic functions with TLS enabled email services (such as Gmail).




Edited on 2009-02-20 22:25:27 by InformaPlus [spacing 2]

No differences.


Edited on 2009-02-20 22:24:47 by InformaPlus [Spacing 1]

No differences.


Edited on 2009-02-20 22:23:20 by InformaPlus [step 4 2]

Additions:
Exp= MailSend('<FromEmail>','<ToEmail>',,,'Test Email','Hello Email',")

Deletions:
Exp= MailSend('<FromEmail>','<ToEmail>','','','Test Email','Hello Email',")



Edited on 2009-02-20 22:22:36 by InformaPlus [Step 4]

Additions:
Exp= MailSend('<FromEmail>','<ToEmail>','','','Test Email','Hello Email',")

Deletions:
Exp= MailSend('<FromEmail>','<ToEmail>',",",'Test Email','Hello Email',")



Edited on 2009-02-20 20:42:31 by InformaPlus [Bold Reasons]

Additions:
Possible reasons for the above test to fail:

Deletions:
Possible reasons for the above test to fail:



Edited on 2009-02-20 20:03:50 by InformaPlus [fix Zero]

Additions:
That is because one (or many) of the error virtuals do not return zero. Refer to the documentation about these errors and to the following notes to try to resolve the issue in your specific environment.

Deletions:
That is because one (or many) of the error virtuals do not return Zero. Refer to the documentation about these errors and to the following notes to try to resolve the issue in your specific environment.



Edited on 2009-02-20 20:02:52 by InformaPlus [maybe there]

Additions:
The SmtpServiceName, UserId and Password have to be provided by your email service provider or administrator. It is advisable to test these from the machine that will run this program through a regular email client before. If you can not use these from a regular email client module on this machine, the above MailConnect() function is very likely to fail and so will be the following MailSend() function.
Note: It is not rare that the UserId and Password can be left as blank (' '). Many ISP smtp services do allow non authenticated access to their service on the basis that you are accessing them within their service network.
d) By default the Magic mail functions use port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.
The Magic mail functions are very RAD and reliable in a context for which they are meant to work within. However, there are instances where not being able to configure the email service in a manner that is compatible to what Magic's email functions can support may force you to look at other avenues than the magic mail related functions. These include a product called Blat (just Google) or specific ActiveX objects available for specific services such as Microsoft Outlook.


Deletions:
The SmtpServiceName, UserId and Password have to be provided by your email service provider or administrator. It is advisable to test these from the machine that will run this program through a regular email client before. If you can not use these from a regular email client module on this machine, the above MailConnect() function is very likely to fail and so will be the following MailSend() function.
Note: It is not rare that the UserId and Password can be left as blank (' '). Many ISP smtp services do allow non authenticated access to their service on the basis that you are accessing them within their service network.
d) By default the Magic mail functions use port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.
The Magic mail functions are very RAD and reliable in a context for which they are meant to work within. However, there are instances where not being able to configure the email service in a manner that is compatible to what Magic's email functions can support may force you to look at other avenues than the magic mail related functions. These include a product called Blat (just Google) or specific ActiveX objects available for specific services such as Microsoft Outlook.




Edited on 2009-02-20 20:01:10 by InformaPlus [getting there]

Additions:
ErroronSend, Numeric, N5
ErroronDisconnect, Numeric, N5
The SmtpServiceName, UserId and Password have to be provided by your email service provider or administrator. It is advisable to test these from the machine that will run this program through a regular email client before. If you can not use these from a regular email client module on this machine, the above MailConnect() function is very likely to fail and so will be the following MailSend() function.
<FromEmail> and <ToEmail> should be valid email addresses in the context of this smtp email service.
It is very likely that the test email was sent to the <ToEmail> address specified in the mailSend() function above and you are done with your first Magic Email.
b) The '<FromEmail>' email Address is partially validated in the process. It is our experience that 'ABC' may not report errors however the email may not be actually sent as a net result.


Deletions:
ErroronSend, Numeric, N5
ErroronDisconnect, Numeric, N5
The SmtpServiceName, UserId and Password have to be provided by your email service provider or administrator. It is advisable to test these from the machine that will run this program through a regular email client before. If you can not use these from a regular email client module on this machine, the above MailConnect() function is very likely to fail and so will be the following MailSend() function.
<FromEmail> and <ToEmail> should be valid email addresses in the context of this smtp email service.
It is very likely that the test email was sent to the <ToEmail> address specified in the mailSend() function above and you are done with your first Magic Email.
b) The '<FromEmail>' email Address is partially validated in the process. It is our experience that 'ABC' may not report errors however the email may not be actually sent as a net result.




Edited on 2009-02-20 19:58:59 by InformaPlus [Double Quotes 2]

Additions:
ErroronConnect, Numeric, N5

Deletions:
"ErroronConnect", Numeric, N5



Edited on 2009-02-20 19:58:18 by InformaPlus [Double Quotes 1]

Additions:
"ErroronConnect", Numeric, N5

Deletions:
ErroronConnect, Numeric, N5



Edited on 2009-02-20 19:44:34 by InformaPlus [code 6]

Additions:
Exp= MailSend('<FromEmail>','<ToEmail>',",",'Test Email','Hello Email',")
Exp= MailDisconnect(1,'FALSE'LOG)


Deletions:
~~Exp= MailSend('<FromEmail>','<ToEmail>',",",'Test Email','Hello Email',")
Exp= MailDisconnect(1,'FALSE'LOG)



Oldest known version of this page was edited on 2009-02-20 19:44:02 by InformaPlus [first draft]
Page view:

How to Send an Email:


The following will step you through writing and trying your first Magic email sending test program. It also provides insight as to some of the most common reasons why such program may not work in your context and how these could be resolved.

1) Create New program:

Properties:
General:
Name: Send Email
Task Type: Batch
Initial mode: Query
End Task Condition: Yes, After

Data:
Transaction mode: Physical
Transaction begin: None

2) Create 3 numerical Virtuals in this program task Data View:
ErroronConnect, Numeric, N5
ErroronSend, Numeric, N5
ErroronDisconnect, Numeric, N5

3) In Record Suffix Handler add the following operations:

Update ErroronConnect,
 Exp=MailConnect(1,'<SmtpServiceName>','<UserId>','<Password>')


The SmtpServiceName, UserId and Password have to be provided by your email service provider or administrator. It is advisable to test these from the machine that will run this program through a regular email client before. If you can not use these from a regular email client module on this machine, the above MailConnect() function is very likely to fail and so will be the following MailSend() function.

Note: It is not rare that the UserId and Password can be left as blank (' '). Many ISP smtp services do allow non authenticated access to their service on the basis that you are accessing them within their service network.

4) Still in Record Suffix, after above Connect operation, add:
Bloc If ErroronConnect=0
Update ErroronSend, 
~~Exp= MailSend('<FromEmail>','<ToEmail>',",",'Test Email','Hello Email',")
Update ErroronDisconnect,
~~Exp= MailDisconnect(1,'FALSE'LOG)
End Bloc


<FromEmail> and <ToEmail> should be valid email addresses in the context of this smtp email service.
The cc, bcc and attachment have been left blank for the purpose of this simple example.

5) Still in the Record Suffix, after above Sending bloc, add:

Bloc if ErroronConnect=0 and ErroronSend=0 and ErroronDisconnect=0
 Verify Sending Test SUCCESSFUL!, Mode=Warning, Display=Box
Bloc Else
 Verify Sending Test FAILED!, Mode=Warning, Display=Box
End Bloc


6) Verify the Syntax of this program (<F8>).

7) Run the program (<F7>):

If you get a pop up message stating:Sending Test SUCCESSFUL!
It is very likely that the test email was sent to the <ToEmail> address specified in the mailSend() function above and you are done with your first Magic Email.
Bravo!

If you get a pop up message stating: Sending Test FAILED!
That is because one (or many) of the error virtuals do not return Zero. Refer to the documentation about these errors and to the following notes to try to resolve the issue in your specific environment.

Possible reasons for the above test to fail:

There are many possible reasons why the above test may fail. It is not possible to list all possible causes. However, the following enumerates some of the most common reasons why it could be so. Keep in mind that sending and receiving emails is also a matter of the smtp (or IMAP or POP3 for reception) service configuration. You should seek working with the email service provider or administrator in case of any problems.

a) First thing to check is if you specified the right parameters. Check that a regular email client on the same machine can send emails while using those same parameters.

b) The '<FromEmail>' email Address is partially validated in the process. It is our experience that 'ABC' may not report errors however the email may not be actually sent as a net result.

c) We suggest you test sending with an unauthenticated (no user, no password) session and a local recipient. External recipients typically require the SMTP service to relay that in turn require an authenticated (user, password) session.

d) By default the Magic mail functions use port 25. This may be overwritten when specifying the service as: '<SmtpServiceName>:<Port Number>' if a different port is to be used in your environment.

e) Magic mail functions support basic authentication. However, they do not support

Transport Layer Security (TLS) authentication. This is a major cause for not being able to use Magic functions with TLS enabled email services (such as Gmail).
One option then is to look at a utility called Stunnel. This utility can add the SSL security level information required by TLS/SSL services. However, learning about how to use such utility can be a multi-days task in itself. Here are links to investigate further in such case:
http://tech.groups.yahoo.com/group/blat/
http://stunnel.mirt.net/
http://www.stunnel.org/

f) Further debugging can be achieved using some network tracing utility such as:
Etheral, available at: http://www.etheral.com

Conclusion:

The Magic mail functions are very RAD and reliable in a context for which they are meant to work within. However, there are instances where not being able to configure the email service in a manner that is compatible to what Magic's email functions can support may force you to look at other avenues than the magic mail related functions. These include a product called Blat (just Google) or specific ActiveX objects available for specific services such as Microsoft Outlook.

The original version of this page was provided by: InformaPlus
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki trunk
Page was generated in 0.5463 seconds