AnuKass
21st August 2018, 14:51
hii
i'm new for LN..
i want send email from baan .if pressing one button i want to send mail to particular recipient...any sample script ????
pls advise me ..Thank you..
giggty
21st August 2018, 16:27
Like this?
cURL email example
This example shows how an email can be sent to multiple recipients and arbitrary "from" address using cURL. Error handling is not fully handled in this example. The return value of all functions need to be checked when similar code is used in production environments.
Main routine
The basic cURL functions as used in the example below are available starting at bshell TIV level 2001.
function main()
{
long status
string url(100)
long ListId, fp
| This must be the name of your SMTP server.
url = "smtp://mail.infor.com."
status = curl.setopt.url(url)
curl.setopt.mail_from("<sender.name@example.org>")
| This string will be used to specify the authentication address (identity)
| of a submitted message that is being relayed to another server.
curl.setopt.mail_auth("sender.name@example.org")
| Add all mail recipients here.
ListId = 0
ListId = curl.slist.append(ListId,"<recipient1@some.place.org>"))
ListId = curl.slist.append(ListId,"<recipient2@some.other.org>"))
curl.setopt.mail_rcpt(ListId))
| There are various ways to provide the body of the mail. This uses a file.
| The contents of the file should at least have a "Subject: " followed
| by an empty line, followed by the body of the mail.
fp = seq.open("body_of_mail.txt", "r")
curl.setopt.readdata(fp)
curl.setopt.upload(1)
| actually send the mail
status = curl.perform()
seq.close(fp)
}
AnuKass
23rd August 2018, 08:28
Thanks for your reply....giggty...
This is very useful to me..i will try.
jojovalenton
2nd September 2018, 16:37
hi giggty,
i tried ur mail sending script but "Error: Unresolved reference to function 'curl.setopt.mail_from'" appeared during compile. can i ask what is #include or #pragma you used? thanks in advance.
regards,
jojo
tmannais
3rd September 2018, 07:33
hi giggty,
i tried ur mail sending script but "Error: Unresolved reference to function 'curl.setopt.mail_from'" appeared during compile. can i ask what is #include or #pragma you used? thanks in advance.
regards,
jojo
Try #include <bic_curl>
jojovalenton
3rd September 2018, 09:50
hi,
same error still exist, as per above TIV level is 2001. i have two tiv level, i'm not sure which one should be >= 2001 (attached).
regards,
jojo
pradeepcr
6th March 2019, 18:41
Anything similar can be done in Baan 4c4. We are on latest SP and PS.
giggty
24th April 2019, 11:18
i guess it has to be the first one (mine is 2230).