Sending mail

Discussion to talk about software related topics only.
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: Sending mail

Post by Chris Ruff »

So, once again, have you been able to *successfully* send an e-mail through your desired server to your desired email address using one of the examples, (ignore the unwanted browser interface problem for this one question) ?

What is the answer to this one question?

Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

I was able to send email using telnet.

I was unable to send it using the library function. I put it in the web code, it hung up the loading of the page for about 10 seconds, then returned a 0 (no error) but I did not get any mail.

I have two netburner MOD 5270 modules mounted on DEV-70 boards that have the two serial ports and so on. I use one to control an online model RR and the other for the Geiger counter. I would like to get the geiger counter to send an email if the radiation picks up. To get support (at $99 a year) I need the serial number but don't see one on the box or on the circuit board - I may have lost it somehow.

char var_user[80] = "Vlermond@cttestset.com";
char var_pass[80] = "mypassword";
// not actual password
char var_svrip[80] = "66.147.242.85";
char var_from[80] = "vernon@cttestset.net";
char var_to[80] = "vernon@cttestset.com";
char var_sub[80] = "FROM: vernon@cttestset.com\015\012 TO:
vernon@cttestset.com\015\012 subject: testing\015\012";
// the server requires a FROM and TO separated by a cr/lf that must
match the mail to and rcpt values. I put that in the subject.
// if you don't do this in telnet you get a 550 administrative error.
char var_body[80]= "this is a test, it is only a test";
int SendmailResult;
int DNSResult;

// then as the web page loads:
// I have tried this different ways, I commented the DNS result out
//and put it in. I just did IPADDR SMTP_server; with no number.

SMTP_PORT = 26;
IPADDR SMTP_server = 0x4293f255;
// converted IP to hexadecimal just to try that - don't know if this
//is right ??
DNSResult = GetHostByName( var_svrip, &SMTP_server, 0,
TICKS_PER_SECOND * 20 );
SendmailResult = SendMailAuth( SMTP_server, var_user, var_pass,
var_from, var_to, var_sub, var_body );

I print the SendmailResult at the bottom of the web page when testing
this and it reads zero. Note that I don't need to use DNS - I can log
in with my IP address and port number and would like to do that.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Sending mail

Post by rnixon »

Vernon, I'm ready to give up on this, but I'll try one more time because I really want to help.
- Forget about telnet
- Forget about your custom code
- Forget about the library functions
- If you use the netburner example UNMODIFIED, can you send an email using the we page interface?

Please let us know. If the answer is "no", then you can try changing the port number in \nburn\system\mailto.cpp from

WORD SMTP_PORT = 25;
to
WORD SMTP_PORT = 26;

Rebuild the libs, rebuild the netburner example UNMODIFIED, run it and see if you can send a message.

If that works, then go back to your custom app. But you need to prove it works first.
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

It would not import the example as a project for some reason so I made a project and copied all the files - including to the html directory. It compiled and I was able to launch it - but the web page does not come up at all. It gets an "Internet explorer can not display the webpage" when I type in its local http://192.168.0.117/ address.
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

Ok - I got it to work and present the web page. I deleted that project and redid it.

WORD SMTP_PORT = 26;

I did change the port as above.

I get the following:

Error - Could Not Send Mail
DETAILS:
DNS lookup of "69.224.42.174" succeeded
NetBurner Error String from last mail transaction:
Failed initial connection to SMTP server, check that server IP/port number are correct.

Server data recieved in last mail transaction:

To: vernon@cttestset.com
From: vernon@cttestset.com
Subject: this a test111
Body: this is a test
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

66.147.242.85 - I tried again with the right IP and added a line to set the

SMTP_PORT = 26;

just above the dnsresult as I am not sure that the mailto file was built into an o file.

Still no luck
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

When I try to rebuild all system files I get a Java null pointer error. So I am not sure that port number change is implemented.
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

I managed to rebuild all system files - still the same result.
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

IT WORKS !

I SENT MAIL TO MYSELF !!!

WHOOOO WHEEE !

This is my greatest thrill ever ! (I don't get out much)

Now if I can adapt it to sending mail without filling out a form ...
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Sending mail

Post by Vernon »

OK ! The mail works from my application !

I saved myself $99 !

What should I buy with all that money ?
Post Reply