Sign in to follow this  
Followers 0
Erik.

INetSmtpMail

6 posts in this topic

Hi,

I wanted to send a mail to people and i found the function in autoit help file.

My problem is i want to make a ini file and when i send the mail it needs to read the while inifile and put is as $as_Body so thats you text

How to do that when you have more lines and let the program knows you have more lines.

Does someone have a little example code for me

Greats Erik


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites



Im not sure what you want exactly:

1)Send multiple emails to diffrent addresses, all data read from an ini file

2)Send a single email to a single address, all data read from an ini file.

Well if its the second here is your answer

#include <INet.au3>

$s_SmtpServer   =IniRead("myini.ini", "Send_mail", "SMTP_server", "")
$s_FromName =IniRead("myini.ini", "Send_mail", "from_name", "")
$s_FromAddress  =IniRead("myini.ini", "Send_mail", "from_address", "")
$s_ToAddress    =IniRead("myini.ini", "Send_mail", "to_address", "")
$s_Subject  =IniRead("myini.ini", "Send_mail", "subject", "")
$body_temp  =IniReadSection("myini.ini", "EmailBody")

$n=$body_temp[0][0]
Dim $as_body[$n]

For $i=1 To $n
    $as_body[$i-1]=$body_temp[$i][1]
Next

_INetSmtpMail ( $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress ,$s_Subject ,$as_Body)

And your INI file should look like this

[Send mail]
SMTP_server=smtp.ispdomain.com
from_name=John
from_address=john@domain.com
to_address=mary@domain.com
subject=your email subject
[EmailBody]
line1=Helo Mary
line2=How are you?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Option 2 i needed

Thanks allot!

I was looking for it

Thanks

EDIT:

I have one more question

I need to send a mail like this:

Welcome at ...

Yourname is: (then guictrlread($name)) can you set that into a ini file or not?

How can i fix this that it works?

Edited by Erik.

I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

I have one more question

I need to send a mail like this:

Welcome at ...

Yourname is: (then guictrlread($name)) can you set that into a ini file or not?

How can i fix this that it works?

You want to make a program to send a mail to a user when he registers on a website or on a server aplication from your computer?

Share this post


Link to post
Share on other sites

Aplication from an computer,

It works fine now i have everything typed in my program so i can use guictrlread, when you use that into an ini file you don't get the data of that gui but the text guictrlread and i need to data so i needed to put it into my program...


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

Hi,

The mail sending works perfect but i only have one problem...

At the place where the program needs to work the have as provider @home there mail server is mail.home.nl but that does not work i gues it's not an smtp i am not working this is how you need ot send the mail..

Is there a smtp server i can use to send the mail? whitout paying or something?


I little problem, hard to find and fix

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0