| View previous topic :: View next topic |
| Author |
Message |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Mon Aug 11, 2003 3:03 am Post subject: Email ?? |
|
|
| Im trying to make a Program that has a Bilt in Email Function , I use to use a command line program called Postie to do it but i cant seem to get it to work ... Iv got the program saving the message to a Txt file ... I just started to mess with VDS agen after a while , So im still using VDS 3 ... Anything would be a big help .... |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Mon Aug 11, 2003 5:37 am Post subject: |
|
|
I could not get your question properly.
Do you want to create an app that has a complete functionality of sending and recieving mails ? - then you should one of the several VDS extension dlls available.
If your intention is just send a mail with files attached to a default mail client e.g Outlook express already set up on the clients machine you can try this one for VDS 4.x:
http://forum.vdsworld.com/viewtopic.php?t=1706
May be one or two commands need maodification(remove progrees indicator etc) to make it work in VDS 3. I am currently not in a position to test it. You can test it and some one can surely help U more.
Regards _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Aug 11, 2003 6:36 am Post subject: |
|
|
As CodeScript suggests the easiest way will be one of the DLLs that can handle the SMTP protocol. As
far as I remember the VDSIPP and VDSDLL packages both support SMTP and include sample scripts.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Aug 11, 2003 8:29 am Post subject: |
|
|
And the VDS Internet Suite located at www.dialogscript.com
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Aug 11, 2003 8:46 am Post subject: Re: Email ?? |
|
|
| TomC wrote: | | So im still using VDS 3 ... |
The Internet Suite is only compatible to VDS 5, as far as I remember..
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Mon Aug 11, 2003 1:10 pm Post subject: ... |
|
|
| Im looking to have it so when a user returns an error all they have to do it hit "report error" and it will send the the .txt file with the Error on it .. Also im not the best in the world with VDS and iv never tryed messing with .dlls ... thanks for the help so far but if anyone can brake it down to "dumb people terms" id be ok |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Mon Aug 11, 2003 1:25 pm Post subject: |
|
|
The example below uses the vdsipp to send the email with and assigns the code to a label.. Download VDSIPP: http://www.vdsworld.com/index.php?page=download&fileid=17
| Code: |
:report-errorCLICK
%%mailserver = "mail.emailserver.com"
%%email = "error-report@emailserver.com"
%%message = "C:\error-report.txt"
external vdsipp,DEMO
INTERNET SMTP,CREATE,1
INTERNET SMTP,THREADS,1,OFF
rem INTERNET SMTP,AUTHENTICATE,1,username,password
INTERNET SMTP,CONNECT,1,%%mailserver,25
INTERNET SMTP,FROM,1,%%email
INTERNET SMTP,TO,1,%%email
INTERNET SMTP,SUBJECT,1,Program Error Report
INTERNET STMP,BODY,1,Error Report Attached
INTERNET SMTP,ATTACH,1,%%message
INTERNET SMTP,SEND,1
goto evloop
|
That would be a very basic way to send an email. I attached the error log file to the email message, you could just as well put the contents of the error log file into the body of the email message too. Note you need to change the variables above to your correct email server, email address and the location of the error file. Also I 'remd' out the AUTHENTICATE line, you may need to uncomment this depending on your email server, personally I wouldn't include my user/pass in any exe that I distribute to other users as this can be sniffed out and lead to a huge security risk for your email server.
Last edited by PGWARE on Mon Aug 11, 2003 1:39 pm; edited 1 time in total |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Mon Aug 11, 2003 1:29 pm Post subject: |
|
|
If you need to do this the secure way what you should do is setup a formmail script on your website, then use the HTTP internet protocol to connect to the formmail/php script and send the appropriate error log/message. I recommend using HTTP and a formmail/php script because this way your email is always sent, some isp's (cox, aol, netzero, and many isps) do not allow 3rd party smtp servers, they require their own smtp server/email server to be used when sending email from the computer, thus the example I provided above wouldn't work. But if you use HTTP to connect to a php/formmail script the email will always be sent.
Heres more information/link on how to achieve this with a php script/formmail script and using HTTP internet protocol: http://forum.vdsworld.com/viewtopic.php?t=1694&start=15&postdays=0&postorder=asc&highlight=send+email
Security issue:
Make sure the formmail has all email address predefined this way no one can exploit your formmail script and send out spam from your server. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Aug 11, 2003 1:47 pm Post subject: |
|
|
Making a PHP script to do this would be very simple. Here's a basic example
if you need it:
| Code: | <?php
// By FreezingFire
// FreezingFire@vdsworld.com
$mailto = "your@address.com";
$from = "From: from@address.com\n";
$subject = "Place Subject Here";
$body = "Place Message Text Here";
mail("$mailto", "$subject", "$body", "$from");
?> |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Tue Aug 12, 2003 6:41 pm Post subject: ... |
|
|
| thanks PG but This isnt a big program & im not looking to spend the extra cash on the .dll ... as far as the php scrip im guessing i just save that as yaddaydda.php and upload it to my domain right ? But how would i get the program to send the data to the php scrip ??sorry to be such a newbie , thanks for the help so far ! |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Aug 12, 2003 7:05 pm Post subject: |
|
|
Well if you don't want to use a dll you can do it with run or shell execute.
shell execute,http://whatever.com/report.php?"from=jane@doe.com"&body="whatever text here to report the error"
that will cause a browser window to open and execute your php script. You could even have the php script then display a friendly message to the user telling them the error has been reported.
As for your server supporting PHP, it should if your host allows it. Most hosting providers likely have support for php, if they don't then you can of course use cgi, php, java instead of php to do the same thing. |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Aug 13, 2003 4:08 am Post subject: |
|
|
And if you want to attach a binary file/image then use the freeware MIME encoder that I used in http://forum.vdsworld.com/viewtopic.php?t=1706
the script file shows you how to interface it such that file is inserted MIME Encoded into the body (this is how attachments are sent). _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
TomC Newbie
Joined: 11 Aug 2003 Posts: 8
|
Posted: Wed Aug 13, 2003 5:55 am Post subject: ..... |
|
|
| That works great , but is there anyway to add the error code into the email ?? The Above code would work fine but the error code can change .... Anyway i could just put in a %E into the email somehow ? |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 13, 2003 6:34 am Post subject: |
|
|
In PGWARE's example you can put anything into the command line calling your server:
| Code: | | shell execute,http://whatever.com/report.php?"from=jane@doe.com"&body="whatever text here to report the error" |
In the part after body= you can put whatever text you like - an errorcode, a description, or
anything you need to debug the error. Just remember to put VDS variables outside the quotes..
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Aug 13, 2003 1:49 pm Post subject: |
|
|
If you're look how to get the errorcode, take a look at the @error()
function. It can be used in conjunction with OPTION ERRORTRAP.
Use @error(e) to get the error code, and @error(n) to get the line number.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|