system.net.mail

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/24/2010 5:23:23 AM
Gravatar
Total Posts 22

system.net.mail

hi mojos,

I created an .aspx page for my sending mail purposes, put it int the root folder.

Im wondering why mojo deosn't detect the object smtpclent in the system.net.mail namespace.

They said that web.mail is obsolete already so I use the .net.mail. It doesnt appear in my intellicense.

If I run the page It always give me an error "Object reference not set to an instance of an object".

Any suggestions please?

Thanks! 

5/24/2010 9:54:51 AM
Gravatar
Total Posts 111
Matt Millican InternetMill

Re: system.net.mail

There is a built-in mail function in mojoPortal that you should use.  See this forum post:

http://www.mojoportal.com/Forums/Thread.aspx?thread=4221&mid=34&pageid=5&ItemID=9

Hope it helps,
Matt

5/24/2010 1:03:18 PM
Gravatar
Total Posts 18439

Re: system.net.mail

Hi,

It is true that we don't have a reference to System.Net from the mojoPortal.Web project since we wrap email methods in a helper class in mojoPortal.Net namespace which is in a different project. So in mojoPortal.Web we only need a reference to mojoPortal.Net.

If you implement your custom code in your own projects as recommended then you can add whatever references you like. I don't recommend you compiling your code into the same projects as mojoPortal.

If using an inline code file just dropped in without adding to the project do this:

<%@ Import Namespace="System.Net" %>

<script runat="server">...

but as Matt has said it is easier to use our helper method.

Note however that our helper method uses the smtp settings from the appSettings section not the ones from the system.net.mailsettings section of web.config.

Hope it helps,

Joe

5/24/2010 10:27:44 PM
Gravatar
Total Posts 22

Re: system.net.mail

thanks for the replies..

by the way.. im using the intranet settings, no internet access. so im assuming that I cannot use the yahoo or gmail settings for the smtp configuration?

do I have to configure the server's IIS and use the mojoPortal.Net? instead of the web.config.

Thanks!

5/25/2010 11:31:55 AM
Gravatar
Total Posts 18439

Re: system.net.mail

The only way it can work is if you configure it for an smtp server that is accessible from the web server. If the web server can talk to the internet then you could use yahoo or gmail but if the web server cannot access the internet then you would have to use some other smtp server on your local network that does have the ability to relay mail to the internet.

Hope it helps,

Joe

6/7/2010 4:01:47 AM
Gravatar
Total Posts 22

Re: system.net.mail

Hi Sir Joe,

I dont think the web server can connect to the internet. Permissions on my client are so strict.

Anyway, I tried using the Mojoportal.Net;

Created on IIS the Default smtp virtual server - corporate.com

Here is my code on the aspx page I created.

I just use javascrtipt on the html module of the mojoportal under source, on click pop redirect to the aspx page;

on the aspx page - on button click,

 

mojoPortal.Net.SmtpSettings _smtp = new mojoPortal.Net.SmtpSettings();

_smtp.Server = "corporate.com";

mojoPortal.Net.Email.SendEmail(_smtp, "remotebanking@domain.com.ph", "email@domain.com.ph", "", "", "Test Corporate Site", "Thank you", false, mojoPortal.Net.Email.PriorityHigh);

Response.Write("success");

 

it doent have an error. it just print success. but I didnt receive the email

Is it advicable to create an aspx page? and have some coding after redirecting it with javascript on html module?

Iv been doing this for weeks. I need to have a page where user can upload file and the file would go to 1 recipient email.

Please help.

sori but im not totally hardcore when it comes to coding. =)

Thank you in advance

Tomas

You must sign in to post in the forums. This thread is closed to new posts.