Re: [MI-L] Send mail

112 views
Skip to first unread message

Mustafa ÖZÇETiN

unread,
Jun 9, 2015, 12:56:59 AM6/9/15
to mapi...@googlegroups.com
.NET DLLs are our powerful friends ;) I have written a small .NET DLL including a SendMail() method to be called from MapBasic. It sends mail using the Yahoo Mail SMTP server and requires a Yahoo mail account as sender. To send mail from your MapBasic program, put the attached MapBasicMail.dll in the same folder with your mbx, declare the DLL method SendMail and call it. For example:

Call SendMail("som...@yahoo.com", "som...@xyz.com", "From Display Name", "FromPassword", "Subject", "Body: Mail from MapBasic!")

See the attached SendMail.mb file. .NET source included. I have tested it and it works fine.

HTH,

Mustafa Özçetin
Senior Researcher (SCJP)

The Scientific and Technological Council of Turkiye

Ankara / Turkiye


--------------------------------------------
On Fri, 5/22/15, senouci hayat <senouci...@gmail.com> wrote:

Subject: [MI-L] Send mail
To: mapi...@googlegroups.com
Date: Friday, May 22, 2015, 9:44 PM

Hello 
How can i send a mail with
mapbasic  
 





--

--

You received this message because you are subscribed to the


Google Groups "MapInfo-L" group.To post a message
to this group, send

email to mapi...@googlegroups.com

To unsubscribe from this group, go to:

http://groups.google.com/group/mapinfo-l/subscribe?hl=en

For more options, information and links to MapInfo resources
(searching

archives, feature requests, to visit our Wiki, visit the
Welcome page at

http://groups.google.com/group/mapinfo-l?hl=en



---

You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.

To unsubscribe from this group and stop receiving emails
from it, send an email to mapinfo-l+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
MapBasicMail.zip

Faruk çağlar

unread,
Jun 9, 2015, 6:44:42 AM6/9/15
to mapi...@googlegroups.com
hi Mustafa ,

is it possible to use the other mail server like gmail. What is needed to change mail server?

Thanks for now



9 Haziran 2015 Salı 07:56:59 UTC+3 tarihinde Mustafa OZCETiN yazdı:

Uffe Kousgaard

unread,
Jun 9, 2015, 6:59:29 AM6/9/15
to mapi...@googlegroups.com
Hi,

You would have to change to:
server = smtp.gmail.com
port = 465

Regards
Uffe Kousgaard

Mustafa ÖZÇETiN

unread,
Jun 9, 2015, 7:47:11 AM6/9/15
to mapi...@googlegroups.com
Hi Faruk,

As Uffe specifies it is possible. You can achieve that by changing the .NET source code, namely Mailer.cs class and recompiling the DLL. Actually I had better make the DLL more customizable. I will let you when I update and publish it.

Mustafa Özçetin
Senior Researcher (SCJP)

The Scientific and Technological Council of Turkiye

Ankara / Turkiye



Faruk çağlar

unread,
Jun 9, 2015, 11:58:15 AM6/9/15
to mapi...@googlegroups.com
Thanks Mustafa, i made with gmail host and it worked but i couldnt find ibm lotus notes mail host .

RF

unread,
Jun 9, 2015, 4:18:19 PM6/9/15
to mapi...@googlegroups.com
Thanks Mustafa!!

Mustafa ÖZÇETiN

unread,
Jun 10, 2015, 1:05:23 AM6/10/15
to mapi...@googlegroups.com
I have improved both the MapBasic and .NET parts so that the mail process will be more customizable. Now you can attach a single file to your mail. For that you need to specify the full path of the file on your disk as the last parameter. Also you can easily define new SMTP servers and ports on the MapBasic part, i.e. you do not need to modify the .NET DLL source. Have a look at the Mail.def and MailTest.mb files. You can grab the files from


Mustafa Özçetin
Senior Researcher (SCJP)

The Scientific and Technological Council of Turkiye

Ankara / Turkiye



--
Reply all
Reply to author
Forward
0 new messages