Hi Henri
You need to enter the email account parameters in your MetaTrader platform. Select Tools then Options then Email and enter the required settings. These are usually the same settings that your email program uses. If you only use webmail you'll have to check your service provider to see if you can get the info required.
The line of code to send an email is
SendMail( string subject, string email body)
Have a look at this thread.
http://www.forexoma.com/forums/support-resistance-crossing-indicator-263.htmlI have created an indicator to raise alerts - including emails - when a trend line is breached or tested. It has been modified quite a bit since I posted the original and the version I am working on now will alert for any trend line instead of only those with specific names.
The email alert contains the name of the trendline, any text in the comments field and the text in a label which I have added to the chart. I'll try to tidy it up a bit and post the update tonight or tomorrow, along with a better explaination.
If you have any ideas of how it should work I'd be happy to see if they can be incorporated.
All the best
Michael