Solved

Jmail Login

Posted on 2004-04-23
8
2,010 Views
Last Modified: 2012-05-04
Hello all,

I am using JMail to send emails.  I need to change the configuration to send the email from a different server.  I have the details of the server, but I dont know the syntax to state the login and password.

This is my existing code:

loMail = CREATEOBJECT("jmail.smtpmail")
loMail.serveraddress = <serveraddress>
loMail.sender = <senderaddress>
loMail.addRecipient("test@test.com")
loMail.subject = "This is a test"
loMail.Body = "This is a test"
loMail.Silent=.T.
lbRetVal = loMail.execute()
RELEASE loMail

I assume it would be something like:
loMail.ServerUserName = <username>
loMail.ServerPassword = <password>

But this does not work...

Please can anyone let me know the correct syntax for this.

Thanks
0
Comment
Question by:charlotte1
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900146
I dont think you need to use username and password, you should just have to allow relaying on the smpt server for the IP address your mail is coming from and you should be fine...
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900190
If you do need to use the username and password you can try this though:
loMail.MailServerUserName = "SomeUserName"
loMail.MailServerPassWord = "SomePassword"
0
 

Author Comment

by:charlotte1
ID: 10900289
I have tried this, but I get the error message "Unknown Member".

Unfortunately I do need to use a login and password as the mail server is not on our network, but it is an internet service.
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900314
I think the login details are only available on the pro version, ie the one you pay for. Looks like you will have to open relays on the smtp server for your web server ip or fork out the cash for the object.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:charlotte1
ID: 10900325
Please can you explain how I would do this.

Thanks
0
 

Author Comment

by:charlotte1
ID: 10900348
I mean, how I would open relays on the SMTP Server for our web server IP
0
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 250 total points
ID: 10900388
In IIS, right click on your SMTP node, click properties. Go to the Access tab, and at the bottom click the Relay... Button. A pop up will appear, enter the ip address of your web server in the first box and bob's your uncle, you can send emails again...
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10900511
Why don't you just use CDOSYS instead of JMail, it's free and comes with Windows, and you can relay it off any SMTP servers that allow it.

CDO runs on Windows 2003, CDONTs does not.


Code below works, I use it: uses port 25, no configuration. Had problem with configuration on local machine.

strTo = "toemail@yourdomain.com"    'Make sure the From field has no spaces.
strFrom = "fromemail@yourdomain.com"
strSubject = "Your Subject"
strBody = "The content of email"


' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDO.Message")
   
' Set the properties of the object
objCDOMail.Sender = StrFrom
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.TextBody = strBody


' Some of the more useful ones I've included samples of here:
'objCDOMail.Cc = "mailto:sschofield@aspfree.com;steve@aspfree.com"   Notice this sending to more than one person!
'objCDOMail.Bcc = "sschofield@aspfree.com;steve@aspfree.com"
'objCDOMail.Importance = 1

'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

' Send the message!
objCDOMail.Send

' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objCDOMail = Nothing
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now